Class: VirtualDateElement
- Inherits:
-
Object
- Object
- VirtualDateElement
- Defined in:
- lib/tedium/virtual_date_element.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#attribute_name ⇒ Object
readonly
Returns the value of attribute attribute_name.
-
#root_element ⇒ Object
readonly
Returns the value of attribute root_element.
Instance Method Summary collapse
- #day_element ⇒ Object
-
#initialize(root_element, attribute_name) ⇒ VirtualDateElement
constructor
A new instance of VirtualDateElement.
- #month_element ⇒ Object
- #set(date) ⇒ Object
- #year_element ⇒ Object
Constructor Details
#initialize(root_element, attribute_name) ⇒ VirtualDateElement
Returns a new instance of VirtualDateElement.
4 5 6 7 |
# File 'lib/tedium/virtual_date_element.rb', line 4 def initialize(root_element, attribute_name) @root_element = root_element @attribute_name = attribute_name end |
Instance Attribute Details
#attribute_name ⇒ Object (readonly)
Returns the value of attribute attribute_name.
2 3 4 |
# File 'lib/tedium/virtual_date_element.rb', line 2 def attribute_name @attribute_name end |
#root_element ⇒ Object (readonly)
Returns the value of attribute root_element.
2 3 4 |
# File 'lib/tedium/virtual_date_element.rb', line 2 def root_element @root_element end |
Instance Method Details
#day_element ⇒ Object
23 24 25 |
# File 'lib/tedium/virtual_date_element.rb', line 23 def day_element token_element('3i') end |
#month_element ⇒ Object
19 20 21 |
# File 'lib/tedium/virtual_date_element.rb', line 19 def month_element token_element('2i') end |
#set(date) ⇒ Object
9 10 11 12 13 |
# File 'lib/tedium/virtual_date_element.rb', line 9 def set(date) year_element.set(date.year) month_element.set(date.month) day_element.set(date.day) end |
#year_element ⇒ Object
15 16 17 |
# File 'lib/tedium/virtual_date_element.rb', line 15 def year_element token_element('1i') end |