Class: IceCube::Validations::MonthOfYear::Validation
- Inherits:
-
Object
- Object
- IceCube::Validations::MonthOfYear::Validation
- Includes:
- Lock
- Defined in:
- lib/ice_cube/validations/month_of_year.rb
Constant Summary
Constants included from Lock
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
-
#initialize(month) ⇒ Validation
constructor
A new instance of Validation.
- #type ⇒ Object
Methods included from Lock
Constructor Details
#initialize(month) ⇒ Validation
Returns a new instance of Validation.
21 22 23 |
# File 'lib/ice_cube/validations/month_of_year.rb', line 21 def initialize(month) @month = month end |
Instance Attribute Details
#month ⇒ Object (readonly) Also known as: value
Returns the value of attribute month.
18 19 20 |
# File 'lib/ice_cube/validations/month_of_year.rb', line 18 def month @month end |
Instance Method Details
#build_hash(builder) ⇒ Object
29 30 31 |
# File 'lib/ice_cube/validations/month_of_year.rb', line 29 def build_hash(builder) builder.validations_array(:month_of_year) << month end |
#build_ical(builder) ⇒ Object
33 34 35 |
# File 'lib/ice_cube/validations/month_of_year.rb', line 33 def build_ical(builder) builder['BYMONTH'] << month end |
#build_s(builder) ⇒ Object
25 26 27 |
# File 'lib/ice_cube/validations/month_of_year.rb', line 25 def build_s(builder) builder.piece(:month_of_year) << Date::MONTHNAMES[month] end |
#type ⇒ Object
37 38 39 |
# File 'lib/ice_cube/validations/month_of_year.rb', line 37 def type :month end |