Class: DocWrapper::TimePropertyDefinition

Inherits:
InnerHtmlPropertyDefinition show all
Defined in:
lib/doc_wrapper/time_property_definition.rb

Instance Attribute Summary

Attributes inherited from BasePropertyDefinition

#block, #options, #property_name, #selector, #type

Instance Method Summary collapse

Methods inherited from InnerHtmlPropertyDefinition

#get_nodes, #property, #raw_property

Methods inherited from BasePropertyDefinition

#initialize, #property

Constructor Details

This class inherits a constructor from DocWrapper::BasePropertyDefinition

Instance Method Details

#transform(result) ⇒ Object



5
6
7
8
9
10
11
12
# File 'lib/doc_wrapper/time_property_definition.rb', line 5

def transform (result)
  if block
    result = block.call(result)
  else
    result = result.blank? ? nil : (options[:parser] ? options[:parser].call(result) : Time.parse(result))
  end
  result
end