Module: Wms::Api::Event

Extended by:
ActiveSupport::Concern
Defined in:
lib/wms/api/event.rb

Defined Under Namespace

Modules: ClassMethods

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#eventsObject

private



10
11
12
# File 'lib/wms/api/event.rb', line 10

def events
  @events
end

#optionsObject

Returns the value of attribute options.



7
8
9
# File 'lib/wms/api/event.rb', line 7

def options
  @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(options={})
  # 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(options) 
end

#initializeObject



19
20
21
22
# File 'lib/wms/api/event.rb', line 19

def initialize
  super
  @events = Event
end