Class: FB2rb::FB2Date
- Inherits:
-
Object
- Object
- FB2rb::FB2Date
- Defined in:
- lib/fb2rb.rb
Overview
Holds <date> data
Instance Attribute Summary collapse
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(display_value: '', value: nil) ⇒ FB2Date
constructor
A new instance of FB2Date.
- #to_xml(xml) ⇒ Object
Constructor Details
#initialize(display_value: '', value: nil) ⇒ FB2Date
Returns a new instance of FB2Date.
565 566 567 568 |
# File 'lib/fb2rb.rb', line 565 def initialize(display_value: '', value: nil) @display_value = display_value @value = value end |
Instance Attribute Details
#display_value ⇒ String
561 562 563 |
# File 'lib/fb2rb.rb', line 561 def display_value @display_value end |
#value ⇒ Date?
563 564 565 |
# File 'lib/fb2rb.rb', line 563 def value @value end |
Class Method Details
Instance Method Details
#to_xml(xml) ⇒ Object
578 579 580 581 582 |
# File 'lib/fb2rb.rb', line 578 def to_xml(xml) xml.date(@display_value) do xml.parent['value'] = @value.to_s unless value.nil? end end |