Class: Sunniesnow::Event
- Inherits:
-
Object
- Object
- Sunniesnow::Event
- Defined in:
- lib/sscharter/chart.rb
Instance Attribute Summary collapse
-
#properties ⇒ Object
readonly
Returns the value of attribute properties.
-
#time ⇒ Object
Returns the value of attribute time.
-
#type ⇒ Object
Returns the value of attribute type.
Instance Method Summary collapse
- #[](key) ⇒ Object
- #[]=(key, value) ⇒ Object
-
#initialize(time, type, **properties) ⇒ Event
constructor
A new instance of Event.
- #to_json(*args) ⇒ Object
Constructor Details
#initialize(time, type, **properties) ⇒ Event
82 83 84 85 86 |
# File 'lib/sscharter/chart.rb', line 82 def initialize time, type, **properties @time = time @type = type @properties = properties end |
Instance Attribute Details
#properties ⇒ Object (readonly)
Returns the value of attribute properties.
80 81 82 |
# File 'lib/sscharter/chart.rb', line 80 def properties @properties end |
#time ⇒ Object
Returns the value of attribute time.
79 80 81 |
# File 'lib/sscharter/chart.rb', line 79 def time @time end |
#type ⇒ Object
Returns the value of attribute type.
79 80 81 |
# File 'lib/sscharter/chart.rb', line 79 def type @type end |
Instance Method Details
#[](key) ⇒ Object
88 89 90 |
# File 'lib/sscharter/chart.rb', line 88 def [] key @properties[key] end |
#[]=(key, value) ⇒ Object
92 93 94 |
# File 'lib/sscharter/chart.rb', line 92 def []= key, value @properties[key] = value end |
#to_json(*args) ⇒ Object
96 97 98 |
# File 'lib/sscharter/chart.rb', line 96 def to_json *args {time: @time, type: @type, properties: @properties}.to_json end |