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.
- #type ⇒ Object
Methods inherited from FixedValue
Constructor Details
#initialize(month) ⇒ Validation
Returns a new instance of Validation.
22 23 24 |
# File 'lib/ice_cube/validations/month_of_year.rb', line 22 def initialize(month) @month = month end |
Instance Attribute Details
#month ⇒ Object (readonly) Also known as: value
Returns the value of attribute month.
19 20 21 |
# File 'lib/ice_cube/validations/month_of_year.rb', line 19 def month @month end |
Instance Method Details
#build_hash(builder) ⇒ Object
38 39 40 |
# File 'lib/ice_cube/validations/month_of_year.rb', line 38 def build_hash(builder) builder.validations_array(:month_of_year) << month end |
#build_ical(builder) ⇒ Object
42 43 44 |
# File 'lib/ice_cube/validations/month_of_year.rb', line 42 def build_ical(builder) builder['BYMONTH'] << month end |
#build_s(builder) ⇒ Object
34 35 36 |
# File 'lib/ice_cube/validations/month_of_year.rb', line 34 def build_s(builder) builder.piece(:month_of_year) << IceCube::I18n.t("ice_cube.date.month_names")[month] end |
#dst_adjust? ⇒ Boolean
30 31 32 |
# File 'lib/ice_cube/validations/month_of_year.rb', line 30 def dst_adjust? true end |
#type ⇒ Object
26 27 28 |
# File 'lib/ice_cube/validations/month_of_year.rb', line 26 def type :month end |