BBB 0.0.7 → 0.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3,7 +3,7 @@ module BBB
3
3
  class AnalogComponent
4
4
  include Pinnable
5
5
 
6
- attr_reader :pin
6
+ attr_reader :pin, :pins
7
7
 
8
8
  def initialize
9
9
  @pin = BBB::IO::AnalogPin.new
@@ -11,14 +11,16 @@ module BBB
11
11
  # Currently only converts IO::DigitalPins
12
12
  #
13
13
  def convert(pin, opts={})
14
+ opts = {:mock=>mock}.merge(opts)
15
+
14
16
  base_class = pin.class.to_s.split("::").last
15
17
  if GPIO.const_defined?(base_class)
16
18
  klass = GPIO::const_get(base_class.to_sym)
19
+ return klass.new(pin.position, pin.mode, opts)
17
20
  elsif ADC.const_defined?(base_class)
18
21
  klass = ADC::const_get(base_class.to_sym)
22
+ return klass.new(pin.position, opts)
19
23
  end
20
- opts = {:mock=>mock}.merge(opts)
21
- return klass.new(pin.position, pin.mode, opts)
22
24
  end
23
25
 
24
26
  end
data/lib/BBB/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module BBB
2
- VERSION = "0.0.7"
2
+ VERSION = "0.0.8"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: BBB
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
4
+ version: 0.0.8
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -144,7 +144,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
144
144
  version: '0'
145
145
  segments:
146
146
  - 0
147
- hash: -2077311598260566956
147
+ hash: -825880762915958157
148
148
  required_rubygems_version: !ruby/object:Gem::Requirement
149
149
  none: false
150
150
  requirements:
@@ -153,7 +153,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
153
153
  version: '0'
154
154
  segments:
155
155
  - 0
156
- hash: -2077311598260566956
156
+ hash: -825880762915958157
157
157
  requirements: []
158
158
  rubyforge_project:
159
159
  rubygems_version: 1.8.25