Module: Oschii
- Defined in:
- lib/oschii.rb,
lib/oschii/cloud.rb,
lib/oschii/config.rb,
lib/oschii/device.rb,
lib/oschii/version.rb,
lib/oschii/servlets.rb,
lib/oschii/template.rb,
lib/oschii/component.rb,
lib/oschii/http_device.rb,
lib/oschii/osc_monitor.rb,
lib/oschii/serial_device.rb
Defined Under Namespace
Classes: Cloud, Component, Config, Device, GetDevices, HttpDevice, OscMonitor, RefreshCloud, SerialDevice, Servlet, Template
Constant Summary
collapse
- LOGO =
"
╔═╗┌─┐┌─┐┬ ┬┬┬
║ ║└─┐│ ├─┤││
╚═╝└─┘└─┘┴ ┴┴┴
#{"ruby gem #{VERSION}".center(14)}
".freeze
- COMPONENT_TYPES =
LOGO = ‘ ╔═╗┌─┐┌─┐┬ ┬┬┬║ ║└─┐│ ├─┤││╚═╝└─┘└─┘┴ ┴┴┴’
%w(Sensor Driver Reporter Listener Monitor State Timer Pixel I2C).freeze
- I2C =
'I2C'.freeze
- BASIC_COMPONENT_TYPES =
COMPONENT_TYPES.reject { |t| t == I2C }.freeze
- TemplateError =
Class.new(StandardError)
- DeviceUnavailable =
Class.new(StandardError)
- NoConnection =
Class.new(StandardError)
- VERSION =
'0.0.6'
Class Method Summary
collapse
Instance Method Summary
collapse
Class Method Details
.included(base) ⇒ Object
18
19
20
21
22
|
# File 'lib/oschii.rb', line 18
def self.included(base)
base.class_eval do
puts LOGO
end
end
|
Instance Method Details
#cloud(silent: false) ⇒ Object
24
25
26
|
# File 'lib/oschii.rb', line 24
def cloud(silent: false)
@cloud ||= Cloud.new(silent: silent)
end
|
#populate ⇒ Object
28
29
30
|
# File 'lib/oschii.rb', line 28
def populate
cloud.populate
end
|
#send_osc(ip, address, *values, port: 3333) ⇒ Object
42
43
44
|
# File 'lib/oschii.rb', line 42
def send_osc(ip, address, *values, port: 3333)
OSC::Client.new(ip, port).send(OSC::Message.new(address, *values.to_a))
end
|
#serial ⇒ Object
38
39
40
|
# File 'lib/oschii.rb', line 38
def serial
@serial ||= cloud.find_serial
end
|
#serve_forever ⇒ Object
32
33
34
35
36
|
# File 'lib/oschii.rb', line 32
def serve_forever
populate
puts 'Press ENTER to quit....'
gets
end
|