Class: Ellen::SyoboiCalendar::Record
- Inherits:
-
Object
- Object
- Ellen::SyoboiCalendar::Record
- Defined in:
- lib/ellen/syoboi_calendar/record.rb
Instance Attribute Summary collapse
-
#properties ⇒ Object
readonly
Returns the value of attribute properties.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(properties) ⇒ Record
constructor
A new instance of Record.
Constructor Details
#initialize(properties) ⇒ Record
Returns a new instance of Record.
24 25 26 |
# File 'lib/ellen/syoboi_calendar/record.rb', line 24 def initialize(properties) @properties = properties end |
Instance Attribute Details
#properties ⇒ Object (readonly)
Returns the value of attribute properties.
22 23 24 |
# File 'lib/ellen/syoboi_calendar/record.rb', line 22 def properties @properties end |
Class Method Details
.property(*names) ⇒ Object
5 6 7 8 9 10 11 |
# File 'lib/ellen/syoboi_calendar/record.rb', line 5 def property(*names) names.each do |name| define_method(name) do properties[name] end end end |
.time_property(*names) ⇒ Object
13 14 15 16 17 18 19 |
# File 'lib/ellen/syoboi_calendar/record.rb', line 13 def time_property(*names) names.each do |name| define_method(name) do Time.parse(properties[name]) end end end |