Class: Date::Format::Bag

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

Constructor Details

#initializeBag

Returns a new instance of Bag.



114
115
116
# File 'lib/date/format.rb', line 114

def initialize
  @extra = {}
end

Instance Attribute Details

#_centObject

Returns the value of attribute _cent.



121
122
123
# File 'lib/date/format.rb', line 121

def _cent
  @_cent
end

#_compObject

Returns the value of attribute _comp.



121
122
123
# File 'lib/date/format.rb', line 121

def _comp
  @_comp
end

#_meridObject

Returns the value of attribute _merid.



121
122
123
# File 'lib/date/format.rb', line 121

def _merid
  @_merid
end

#hourObject

Returns the value of attribute hour.



118
119
120
# File 'lib/date/format.rb', line 118

def hour
  @hour
end

#mdayObject

Returns the value of attribute mday.



118
119
120
# File 'lib/date/format.rb', line 118

def mday
  @mday
end

#minObject

Returns the value of attribute min.



118
119
120
# File 'lib/date/format.rb', line 118

def min
  @min
end

#monObject

Returns the value of attribute mon.



118
119
120
# File 'lib/date/format.rb', line 118

def mon
  @mon
end

#offsetObject

Returns the value of attribute offset.



119
120
121
# File 'lib/date/format.rb', line 119

def offset
  @offset
end

#secObject

Returns the value of attribute sec.



118
119
120
# File 'lib/date/format.rb', line 118

def sec
  @sec
end

#sec_fractionObject

Returns the value of attribute sec_fraction.



118
119
120
# File 'lib/date/format.rb', line 118

def sec_fraction
  @sec_fraction
end

#yearObject

Returns the value of attribute year.



118
119
120
# File 'lib/date/format.rb', line 118

def year
  @year
end

#zoneObject

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_hashObject



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