Class: Parade::Metadata::Assignment

Inherits:
Object
  • Object
show all
Defined in:
lib/parade/metadata/assignment.rb

Overview

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.

Examples:

Settings the Metadata id


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

See Also:

Instance Method Summary collapse

Instance Method Details

#apply(term, hash) ⇒ Object



23
24
25
26
27
# File 'lib/parade/metadata/assignment.rb', line 23

def apply(term,hash)
  key, value = parse(term)
  hash[key] = value
  hash
end

#match?(term) ⇒ Boolean

Returns:

  • (Boolean)


19
20
21
# File 'lib/parade/metadata/assignment.rb', line 19

def match?(term)
  term =~ /.+=.+/
end