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.
564 565 566 567 |
# File 'lib/fb2rb.rb', line 564 def initialize(display_value: '', value: nil) @display_value = display_value @value = value end |
Instance Attribute Details
#display_value ⇒ String
560 561 562 |
# File 'lib/fb2rb.rb', line 560 def display_value @display_value end |
#value ⇒ Date?
562 563 564 |
# File 'lib/fb2rb.rb', line 562 def value @value end |
Class Method Details
Instance Method Details
#to_xml(xml) ⇒ Object
577 578 579 580 581 |
# File 'lib/fb2rb.rb', line 577 def to_xml(xml) xml.date(@display_value) do xml.parent['value'] = @value.to_s unless value.nil? end end |