class Parade::Metadata::Assignment

The Assignment metadata parser is a general parser that allows the ability to assign a value to the specified field of the metadata. This is usually used for assigning the transition field but could be used to set the id in the metadata.

@example Settings the Metadata id

metadata = Metadata.parse "id=unique-slide-id"
metadata.id # => "unique-slide-id"

@see Metadata

Public Instance Methods

apply(term,hash) click to toggle source
# File lib/parade/metadata/assignment.rb, line 23
def apply(term,hash)
  key, value = parse(term)
  hash[key] = value
  hash
end
match?(term) click to toggle source
# File lib/parade/metadata/assignment.rb, line 19
def match?(term)
  term =~ /.+=.+/
end

Private Instance Methods

parse(term) click to toggle source
# File lib/parade/metadata/assignment.rb, line 31
def parse(term)
  term.split('=')
end