Class: Rabbit::Parser::SlidePropertySetter

Inherits:
Object
  • Object
show all
Defined in:
lib/rabbit/parser.rb

Instance Method Summary collapse

Constructor Details

#initialize(slide) ⇒ SlidePropertySetter

Returns a new instance of SlidePropertySetter.


46
47
48
# File 'lib/rabbit/parser.rb', line 46

def initialize(slide)
  @slide = slide
end

Instance Method Details

#apply(element) ⇒ Object


50
51
52
53
54
55
56
# File 'lib/rabbit/parser.rb', line 50

def apply(element)
  return unless element.is_a?(Element::DescriptionList)
  element.each do |item|
    name = Parser.normalize_property_name(item.term.text)
    @slide[name] = item.content.text.strip
  end
end