Class: MicroMicro::Parsers::BasePropertyParser

Inherits:
Object
  • Object
show all
Defined in:
lib/micro_micro/parsers/base_property_parser.rb

Instance Method Summary collapse

Constructor Details

#initialize(property) ⇒ BasePropertyParser

Returns a new instance of BasePropertyParser.



7
8
9
10
# File 'lib/micro_micro/parsers/base_property_parser.rb', line 7

def initialize(property)
  @property = property
  @node = property.node
end

Instance Method Details

#valueString



18
19
20
21
22
23
# File 'lib/micro_micro/parsers/base_property_parser.rb', line 18

def value
  @value ||=
    Helpers.text_content_from(node) do |context|
      context.css("img").each { |img| img.content = " #{img["alt"] || img["src"]} " }
    end
end