Class: ActiveSensor::Controller

Inherits:
Object
  • Object
show all
Defined in:
lib/active_sensor/controller.rb

Overview

DSL ###

Direct Known Subclasses

Parameter, OpenWeatherMap::VirtualController

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.has_parameter(name, options = {}) ⇒ Object


17
18
19
# File 'lib/active_sensor/controller.rb', line 17

def has_parameter(name, options = {})
  parameters[name] = ActiveSensor::Parameter.new(name.to_sym, options)
end

.inherited(subclass) ⇒ Object


13
14
15
# File 'lib/active_sensor/controller.rb', line 13

def inherited(subclass)
  subclass.parameters = parameters
end

.parametersObject


5
6
7
# File 'lib/active_sensor/controller.rb', line 5

def parameters
  @parameters ||= {}.with_indifferent_access
end

.parameters=(hash) ⇒ Object


9
10
11
# File 'lib/active_sensor/controller.rb', line 9

def parameters=(hash)
  @parameters = hash.with_indifferent_access
end

Instance Method Details

#retrieve(*_args) ⇒ Object


22
23
24
# File 'lib/active_sensor/controller.rb', line 22

def retrieve(*_args)
  raise :not_implemented
end