Class: IceCube::Validations::Day::Validation
- Inherits:
-
FixedValue
- Object
- FixedValue
- IceCube::Validations::Day::Validation
- Defined in:
- lib/ice_cube/validations/day.rb
Constant Summary
Constants inherited from FixedValue
Instance Attribute Summary collapse
-
#day ⇒ Object
(also: #value)
readonly
Returns the value of attribute day.
Instance Method Summary collapse
- #build_hash(builder) ⇒ Object
- #build_ical(builder) ⇒ Object
- #build_s(builder) ⇒ Object
- #dst_adjust? ⇒ Boolean
-
#initialize(day) ⇒ Validation
constructor
A new instance of Validation.
- #key ⇒ Object
- #type ⇒ Object
Methods inherited from FixedValue
Constructor Details
#initialize(day) ⇒ Validation
Returns a new instance of Validation.
26 27 28 |
# File 'lib/ice_cube/validations/day.rb', line 26 def initialize(day) @day = day end |
Instance Attribute Details
#day ⇒ Object (readonly) Also known as: value
Returns the value of attribute day.
23 24 25 |
# File 'lib/ice_cube/validations/day.rb', line 23 def day @day end |
Instance Method Details
#build_hash(builder) ⇒ Object
46 47 48 |
# File 'lib/ice_cube/validations/day.rb', line 46 def build_hash(builder) builder.validations_array(:day) << day end |
#build_ical(builder) ⇒ Object
50 51 52 53 54 55 56 |
# File 'lib/ice_cube/validations/day.rb', line 50 def build_ical(builder) ical_day = IcalBuilder.fixnum_to_ical_day(day) # Only add if there aren't others from day_of_week that override if builder['BYDAY'].none? { |b| b.end_with?(ical_day) } builder['BYDAY'] << ical_day end end |
#build_s(builder) ⇒ Object
42 43 44 |
# File 'lib/ice_cube/validations/day.rb', line 42 def build_s(builder) builder.piece(:day) << day end |
#dst_adjust? ⇒ Boolean
38 39 40 |
# File 'lib/ice_cube/validations/day.rb', line 38 def dst_adjust? true end |
#key ⇒ Object
30 31 32 |
# File 'lib/ice_cube/validations/day.rb', line 30 def key :day end |
#type ⇒ Object
34 35 36 |
# File 'lib/ice_cube/validations/day.rb', line 34 def type :wday end |