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

Returns a new instance of Event.



124
125
126
127
128
# File 'lib/sscharter/chart.rb', line 124

def initialize time, type, **properties
	@time = time
	@type = type
	@properties = properties
end

Instance Attribute Details

#propertiesObject (readonly)

Returns the value of attribute properties.



122
123
124
# File 'lib/sscharter/chart.rb', line 122

def properties
  @properties
end

#timeObject

Returns the value of attribute time.



121
122
123
# File 'lib/sscharter/chart.rb', line 121

def time
  @time
end

#time_dependentObject

Returns the value of attribute time_dependent.



121
122
123
# File 'lib/sscharter/chart.rb', line 121

def time_dependent
  @time_dependent
end

#typeObject

Returns the value of attribute type.



121
122
123
# File 'lib/sscharter/chart.rb', line 121

def type
  @type
end

Instance Method Details

#[](key) ⇒ Object



130
131
132
# File 'lib/sscharter/chart.rb', line 130

def [] key
	@properties[key]
end

#[]=(key, value) ⇒ Object



134
135
136
# File 'lib/sscharter/chart.rb', line 134

def []= key, value
	@properties[key] = value
end

#to_json(*args) ⇒ Object



138
139
140
141
142
# File 'lib/sscharter/chart.rb', line 138

def to_json *args
	result = {time: @time, type: @type, properties: @properties}
	result[:timeDependent] = @time_dependent if @time_dependent
	result.to_json *args
end