Class: Battery
- Inherits:
-
Object
- Object
- Battery
- Extended by:
- Forwardable
- Defined in:
- lib/battery/battery.rb,
lib/battery/version.rb
Constant Summary collapse
- VERSION =
'1.0.0'
Instance Attribute Summary collapse
-
#data_source ⇒ Object
Returns the value of attribute data_source.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Battery
constructor
A new instance of Battery.
- #update ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ Battery
Returns a new instance of Battery.
11 12 13 |
# File 'lib/battery/battery.rb', line 11 def initialize( = {} ) self.data_source = [:data_source] || UPowerDataSource.new end |
Instance Attribute Details
#data_source ⇒ Object
Returns the value of attribute data_source.
9 10 11 |
# File 'lib/battery/battery.rb', line 9 def data_source @data_source end |
Instance Method Details
#update ⇒ Object
32 33 34 35 |
# File 'lib/battery/battery.rb', line 32 def update data_source.update self end |