Class: Omega2Gpio::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/omega2_gpio/configuration.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

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_numberObject

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_levelObject

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 messages
1  ==> puts warnings
0  ==> no messages at all


19
20
21
# File 'lib/omega2_gpio/configuration.rb', line 19

def messaging_level
  @messaging_level
end

#mockObject

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