Class: WiringPi::Modules::ModuleBase
- Inherits:
-
Object
- Object
- WiringPi::Modules::ModuleBase
- Defined in:
- lib/wiringpi.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#pin_base ⇒ Object
readonly
Returns the value of attribute pin_base.
-
#pin_count ⇒ Object
readonly
Returns the value of attribute pin_count.
-
#pin_end ⇒ Object
readonly
Returns the value of attribute pin_end.
Instance Method Summary collapse
-
#initialize ⇒ ModuleBase
constructor
A new instance of ModuleBase.
- #new ⇒ Object
- #update_name ⇒ Object
Constructor Details
#initialize ⇒ ModuleBase
Returns a new instance of ModuleBase.
29 30 31 32 33 34 |
# File 'lib/wiringpi.rb', line 29 def initialize @name = 'Unknown' @pin_base = 0 @pin_count = 0 @pin_end = 0 end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
27 28 29 |
# File 'lib/wiringpi.rb', line 27 def name @name end |
#pin_base ⇒ Object (readonly)
Returns the value of attribute pin_base.
27 28 29 |
# File 'lib/wiringpi.rb', line 27 def pin_base @pin_base end |
#pin_count ⇒ Object (readonly)
Returns the value of attribute pin_count.
27 28 29 |
# File 'lib/wiringpi.rb', line 27 def pin_count @pin_count end |
#pin_end ⇒ Object (readonly)
Returns the value of attribute pin_end.
27 28 29 |
# File 'lib/wiringpi.rb', line 27 def pin_end @pin_end end |
Instance Method Details
#new ⇒ Object
36 37 38 39 |
# File 'lib/wiringpi.rb', line 36 def new @pin_end = @pin_base + @pin_count update_name end |
#update_name ⇒ Object
41 42 43 |
# File 'lib/wiringpi.rb', line 41 def update_name @name = " at offset #{@pin_base}" end |