Class: Icalendar2::Value
- Inherits:
-
Object
- Object
- Icalendar2::Value
- Defined in:
- lib/icalendar2/value.rb
Direct Known Subclasses
BinaryValue, BooleanValue, CalAddressValue, DateTimeValue, DateValue, DurationValue, FloatValue, IntegerValue, LatLonValue, PeriodValue, RecurValue, TextValue, TimeValue, UriValue
Class Attribute Summary collapse
-
.format_matcher ⇒ Object
readonly
Returns the value of attribute format_matcher.
Instance Attribute Summary collapse
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(value) ⇒ Value
constructor
A new instance of Value.
- #to_s ⇒ Object
- #valid? ⇒ Boolean
Constructor Details
#initialize(value) ⇒ Value
Returns a new instance of Value.
19 20 21 22 23 |
# File 'lib/icalendar2/value.rb', line 19 def initialize(value) @valid = true @value = value validate end |
Class Attribute Details
.format_matcher ⇒ Object (readonly)
Returns the value of attribute format_matcher.
4 5 6 |
# File 'lib/icalendar2/value.rb', line 4 def format_matcher @format_matcher end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
7 8 9 |
# File 'lib/icalendar2/value.rb', line 7 def value @value end |
Class Method Details
.get_factory(value_sym) ⇒ Object
13 14 15 16 17 |
# File 'lib/icalendar2/value.rb', line 13 def self.get_factory(value_sym) # :foo => "Foo", :bar_baz => "BarBaz", etc. value_name = value_sym.to_s.split(/_/).map(&:capitalize).join('') Icalendar2.const_get("#{value_name}Value", false) end |
.matches(matcher) ⇒ Object
9 10 11 |
# File 'lib/icalendar2/value.rb', line 9 def self.matches(matcher) @format_matcher = matcher end |
Instance Method Details
#to_s ⇒ Object
29 30 31 |
# File 'lib/icalendar2/value.rb', line 29 def to_s value.to_s end |
#valid? ⇒ Boolean
25 26 27 |
# File 'lib/icalendar2/value.rb', line 25 def valid? @valid end |