Class: MicroMicro::Parsers::BasePropertyParser
- Inherits:
-
Object
- Object
- MicroMicro::Parsers::BasePropertyParser
- Defined in:
- lib/micro_micro/parsers/base_property_parser.rb
Direct Known Subclasses
BaseImpliedPropertyParser, DateTimePropertyParser, EmbeddedMarkupPropertyParser, PlainTextPropertyParser, UrlPropertyParser
Instance Method Summary collapse
-
#initialize(property) ⇒ BasePropertyParser
constructor
A new instance of BasePropertyParser.
- #value ⇒ String
Constructor Details
permalink #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
permalink #value ⇒ String
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 |