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.
20 21 22 23 24 |
# File 'lib/icalendar2/value.rb', line 20 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 18 |
# 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('') value_class_name = "#{value_name}Value" Icalendar2.const_get(value_class_name) if Icalendar2.const_defined?(value_class_name) 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
30 31 32 |
# File 'lib/icalendar2/value.rb', line 30 def to_s value.to_s end |
#valid? ⇒ Boolean
26 27 28 |
# File 'lib/icalendar2/value.rb', line 26 def valid? @valid end |