Class: PiDriver::Pin::DirectoryHelper
- Inherits:
-
Object
- Object
- PiDriver::Pin::DirectoryHelper
- Defined in:
- lib/pi_driver/pin/directory_helper.rb
Constant Summary collapse
- DIR_BASE =
TODO: figure out environment variables for test DIR_BASE = ‘/sys/class’
File. '~/pi/gpio/sys/class'
- DIR_GPIO =
"#{DIR_BASE}/gpio".freeze
Instance Method Summary collapse
- #direction ⇒ Object
- #export ⇒ Object
-
#initialize(gpio_number) ⇒ DirectoryHelper
constructor
A new instance of DirectoryHelper.
- #value ⇒ Object
Constructor Details
#initialize(gpio_number) ⇒ DirectoryHelper
Returns a new instance of DirectoryHelper.
9 10 11 |
# File 'lib/pi_driver/pin/directory_helper.rb', line 9 def initialize(gpio_number) @gpio_number = gpio_number end |
Instance Method Details
#direction ⇒ Object
13 14 15 |
# File 'lib/pi_driver/pin/directory_helper.rb', line 13 def direction "#{dir_pin}/direction" end |
#export ⇒ Object
17 18 19 |
# File 'lib/pi_driver/pin/directory_helper.rb', line 17 def export "#{DIR_GPIO}/export" end |
#value ⇒ Object
21 22 23 |
# File 'lib/pi_driver/pin/directory_helper.rb', line 21 def value "#{dir_pin}/value" end |