Class: IceCube::Validations::MonthOfYear::Validation
- Inherits:
-
FixedValue
- Object
- FixedValue
- IceCube::Validations::MonthOfYear::Validation
- Defined in:
- lib/ice_cube/validations/month_of_year.rb
Constant Summary
Constants inherited from FixedValue
Instance Attribute Summary collapse
-
#month ⇒ Object
(also: #value)
readonly
Returns the value of attribute month.
Instance Method Summary collapse
- #build_hash(builder) ⇒ Object
- #build_ical(builder) ⇒ Object
- #build_s(builder) ⇒ Object
- #dst_adjust? ⇒ Boolean
-
#initialize(month) ⇒ Validation
constructor
A new instance of Validation.
- #key ⇒ Object
- #type ⇒ Object
Methods inherited from FixedValue
Constructor Details
#initialize(month) ⇒ Validation
Returns a new instance of Validation.
20 21 22 |
# File 'lib/ice_cube/validations/month_of_year.rb', line 20 def initialize(month) @month = month end |
Instance Attribute Details
#month ⇒ Object (readonly) Also known as: value
Returns the value of attribute month.
17 18 19 |
# File 'lib/ice_cube/validations/month_of_year.rb', line 17 def month @month end |
Instance Method Details
#build_hash(builder) ⇒ Object
40 41 42 |
# File 'lib/ice_cube/validations/month_of_year.rb', line 40 def build_hash(builder) builder.validations_array(:month_of_year) << month end |
#build_ical(builder) ⇒ Object
44 45 46 |
# File 'lib/ice_cube/validations/month_of_year.rb', line 44 def build_ical(builder) builder["BYMONTH"] << month end |
#build_s(builder) ⇒ Object
36 37 38 |
# File 'lib/ice_cube/validations/month_of_year.rb', line 36 def build_s(builder) builder.piece(:month_of_year) << IceCube::I18n.t("date.month_names")[month] end |
#dst_adjust? ⇒ Boolean
32 33 34 |
# File 'lib/ice_cube/validations/month_of_year.rb', line 32 def dst_adjust? true end |
#key ⇒ Object
24 25 26 |
# File 'lib/ice_cube/validations/month_of_year.rb', line 24 def key :month_of_year end |
#type ⇒ Object
28 29 30 |
# File 'lib/ice_cube/validations/month_of_year.rb', line 28 def type :month end |