Class: Omega2Gpio::Configuration
- Inherits:
-
Object
- Object
- Omega2Gpio::Configuration
- Defined in:
- lib/omega2_gpio/configuration.rb
Instance Attribute Summary collapse
-
#highest_gpio_number ⇒ Object
depends on Onion Omega2 hardware, needed to raise error in mock-mode.
-
#messaging_level ⇒ Object
Controls whether the Gem shall write debug messages to standard out.
-
#mock ⇒ Object
Controls whether the GPIO shall be controlled on Onion Omegas file system or just mocked/faked as valid to allow development on systems that do not support Omega’s GPIO control and would raise errors constantly Defaults to ‘false`.
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
25 26 27 28 29 |
# File 'lib/omega2_gpio/configuration.rb', line 25 def initialize @mock = false @messaging_level = 2 @highest_gpio_number = 46 end |
Instance Attribute Details
#highest_gpio_number ⇒ Object
depends on Onion Omega2 hardware, needed to raise error in mock-mode
23 24 25 |
# File 'lib/omega2_gpio/configuration.rb', line 23 def highest_gpio_number @highest_gpio_number end |
#messaging_level ⇒ Object
Controls whether the Gem shall write debug messages to standard out. This can be helpful messages like file system commands that are mocked Defaults to :debug. Defined are
2 ==> puts all
1 ==> puts warnings
0 ==> no at all
19 20 21 |
# File 'lib/omega2_gpio/configuration.rb', line 19 def messaging_level @messaging_level end |
#mock ⇒ Object
Controls whether the GPIO shall be controlled on Onion Omegas file system or just mocked/faked as valid to allow development on systems that do not support Omega’s GPIO control and would raise errors constantly Defaults to ‘false`. Set to `true` to mock Onion Omega GPIO
9 10 11 |
# File 'lib/omega2_gpio/configuration.rb', line 9 def mock @mock end |