Class: Date::Format::Bag
- Inherits:
-
Object
- Object
- Date::Format::Bag
- Defined in:
- lib/date/format.rb
Overview
:nodoc:
Constant Summary collapse
- Fast =
[:year, :mon, :mday, :hour, :min, :sec, :sec_fraction, :zone, :offset]
Instance Attribute Summary collapse
-
#_cent ⇒ Object
Returns the value of attribute _cent.
-
#_comp ⇒ Object
Returns the value of attribute _comp.
-
#_merid ⇒ Object
Returns the value of attribute _merid.
-
#hour ⇒ Object
Returns the value of attribute hour.
-
#mday ⇒ Object
Returns the value of attribute mday.
-
#min ⇒ Object
Returns the value of attribute min.
-
#mon ⇒ Object
Returns the value of attribute mon.
-
#offset ⇒ Object
Returns the value of attribute offset.
-
#sec ⇒ Object
Returns the value of attribute sec.
-
#sec_fraction ⇒ Object
Returns the value of attribute sec_fraction.
-
#year ⇒ Object
Returns the value of attribute year.
-
#zone ⇒ Object
Returns the value of attribute zone.
Instance Method Summary collapse
- #[](key) ⇒ Object
- #[]=(key, val) ⇒ Object
-
#initialize ⇒ Bag
constructor
A new instance of Bag.
- #to_hash ⇒ Object
Constructor Details
#initialize ⇒ Bag
Returns a new instance of Bag.
114 115 116 |
# File 'lib/date/format.rb', line 114 def initialize @extra = {} end |
Instance Attribute Details
#_cent ⇒ Object
Returns the value of attribute _cent.
121 122 123 |
# File 'lib/date/format.rb', line 121 def _cent @_cent end |
#_comp ⇒ Object
Returns the value of attribute _comp.
121 122 123 |
# File 'lib/date/format.rb', line 121 def _comp @_comp end |
#_merid ⇒ Object
Returns the value of attribute _merid.
121 122 123 |
# File 'lib/date/format.rb', line 121 def _merid @_merid end |
#hour ⇒ Object
Returns the value of attribute hour.
118 119 120 |
# File 'lib/date/format.rb', line 118 def hour @hour end |
#mday ⇒ Object
Returns the value of attribute mday.
118 119 120 |
# File 'lib/date/format.rb', line 118 def mday @mday end |
#min ⇒ Object
Returns the value of attribute min.
118 119 120 |
# File 'lib/date/format.rb', line 118 def min @min end |
#mon ⇒ Object
Returns the value of attribute mon.
118 119 120 |
# File 'lib/date/format.rb', line 118 def mon @mon end |
#offset ⇒ Object
Returns the value of attribute offset.
119 120 121 |
# File 'lib/date/format.rb', line 119 def offset @offset end |
#sec ⇒ Object
Returns the value of attribute sec.
118 119 120 |
# File 'lib/date/format.rb', line 118 def sec @sec end |
#sec_fraction ⇒ Object
Returns the value of attribute sec_fraction.
118 119 120 |
# File 'lib/date/format.rb', line 118 def sec_fraction @sec_fraction end |
#year ⇒ Object
Returns the value of attribute year.
118 119 120 |
# File 'lib/date/format.rb', line 118 def year @year end |
#zone ⇒ Object
Returns the value of attribute zone.
118 119 120 |
# File 'lib/date/format.rb', line 118 def zone @zone end |
Instance Method Details
#[](key) ⇒ Object
123 124 125 |
# File 'lib/date/format.rb', line 123 def [](key) @extra[key] end |
#[]=(key, val) ⇒ Object
127 128 129 |
# File 'lib/date/format.rb', line 127 def []=(key, val) @extra[key] = val end |
#to_hash ⇒ Object
134 135 136 137 138 139 140 141 142 |
# File 'lib/date/format.rb', line 134 def to_hash Fast.each do |x| if val = __send__(x) @extra[x] = val end end @extra end |