Class: Sunniesnow::Event

Inherits:
Object
  • Object
show all
Defined in:
lib/sscharter/chart.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#propertiesObject (readonly)

Returns the value of attribute properties.



80
81
82
# File 'lib/sscharter/chart.rb', line 80

def properties
  @properties
end

#timeObject

Returns the value of attribute time.



79
80
81
# File 'lib/sscharter/chart.rb', line 79

def time
  @time
end

#typeObject

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