Module: Wms::Api::Event
- Extended by:
- ActiveSupport::Concern
- Defined in:
- lib/wms/api/event.rb
Defined Under Namespace
Modules: ClassMethods
Instance Attribute Summary collapse
-
#events ⇒ Object
private.
-
#options ⇒ Object
Returns the value of attribute options.
Instance Method Summary collapse
Instance Attribute Details
#events ⇒ Object
private
10 11 12 |
# File 'lib/wms/api/event.rb', line 10 def events @events end |
#options ⇒ Object
Returns the value of attribute options.
7 8 9 |
# File 'lib/wms/api/event.rb', line 7 def @options end |
Instance Method Details
#get_events(options = {}) ⇒ Object
24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/wms/api/event.rb', line 24 def get_events(={}) # events = Event.all_in(device_id: options[:device_id], # type: options[:type]).between(timestamp: options[:begin]..options[:end]).order_by(:timestamp.asc) # events_hash = [] # if events.length > 0 # events.each do |e| # events_hash.push(Hash[e.attributes]) # end # end # # events_hash Event.where() end |
#initialize ⇒ Object
19 20 21 22 |
# File 'lib/wms/api/event.rb', line 19 def initialize super @events = Event end |