Class: RiCal::PropertyValue::RecurrenceRule::NumberedSpan
- Inherits:
-
Object
- Object
- RiCal::PropertyValue::RecurrenceRule::NumberedSpan
show all
- Defined in:
- lib/ri_cal/property_value/recurrence_rule/numbered_span.rb
Overview
Instance Attribute Summary collapse
Instance Method Summary
collapse
Constructor Details
#initialize(source, rule = nil) ⇒ NumberedSpan
Returns a new instance of NumberedSpan.
8
9
10
11
|
# File 'lib/ri_cal/property_value/recurrence_rule/numbered_span.rb', line 8
def initialize(source, rule = nil)
@source = source
@rule = rule
end
|
Instance Attribute Details
7
8
9
|
# File 'lib/ri_cal/property_value/recurrence_rule/numbered_span.rb', line 7
def source
@source
end
|
Instance Method Details
#==(another) ⇒ Object
17
18
19
|
# File 'lib/ri_cal/property_value/recurrence_rule/numbered_span.rb', line 17
def ==(another)
self.class == another.class && source == another.source
end
|
25
26
27
|
# File 'lib/ri_cal/property_value/recurrence_rule/numbered_span.rb', line 25
def ordinal
@source
end
|
21
22
23
|
# File 'lib/ri_cal/property_value/recurrence_rule/numbered_span.rb', line 21
def to_s
source.to_s
end
|
#valid? ⇒ Boolean
13
14
15
|
# File 'lib/ri_cal/property_value/recurrence_rule/numbered_span.rb', line 13
def valid?
(1..last).include?(source) || (-last..-1).include?(source)
end
|