Class: Parade::Metadata
- Inherits:
-
Object
- Object
- Parade::Metadata
- Defined in:
- lib/parade/metadata.rb,
lib/parade/metadata/html_id.rb,
lib/parade/metadata/template.rb,
lib/parade/metadata/assignment.rb,
lib/parade/metadata/css_classes.rb
Overview
Slides within Parade contain metadata. This metadata allows you to set CSS classes and IDs. You are also able, as well to assigna unique transitions between each slide.
Defined Under Namespace
Classes: Assignment, CSSClasses, HTMLId, Template
Instance Attribute Summary collapse
- #classes ⇒ Object
-
#id ⇒ Object
Returns the value of attribute id.
-
#template ⇒ Object
Returns the value of attribute template.
-
#transition ⇒ Object
Returns the value of attribute transition.
Class Method Summary collapse
- .parse(metadata) ⇒ Object
-
.parsers ⇒ Object
The list of the parsers that are used to parse the metadata string.
Instance Method Summary collapse
-
#initialize(params = {}) ⇒ Metadata
constructor
The initialize method is generally not called directly and instead is used through the
Metadata.parsemethod.
Constructor Details
#initialize(params = {}) ⇒ Metadata
The initialize method is generally not called directly and instead is used through the Metadata.parse method.
57 58 59 |
# File 'lib/parade/metadata.rb', line 57 def initialize(params = {}) params.each {|k,v| send("#{k}=",v) if respond_to? "#{k}=" } end |
Instance Attribute Details
#classes ⇒ Object
63 64 65 |
# File 'lib/parade/metadata.rb', line 63 def classes @classes || [] end |
#id ⇒ Object
Returns the value of attribute id.
67 68 69 |
# File 'lib/parade/metadata.rb', line 67 def id @id end |
#template ⇒ Object
Returns the value of attribute template.
69 70 71 |
# File 'lib/parade/metadata.rb', line 69 def template @template end |
#transition ⇒ Object
Returns the value of attribute transition.
68 69 70 |
# File 'lib/parade/metadata.rb', line 68 def transition @transition end |
Class Method Details
.parse(metadata) ⇒ Object
26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/parade/metadata.rb', line 26 def self.parse() = {} .to_s.split(' ').each do |term| = parsers.find {|parser| parser.match? term } .apply(term,) end self.new end |
.parsers ⇒ Object
The list of the parsers that are used to parse the metadata string.
41 42 43 44 45 46 |
# File 'lib/parade/metadata.rb', line 41 def self.parsers [ Template.new, Assignment.new, HTMLId.new, CSSClasses.new ] end |