Class: BatteryGrowl
- Inherits:
-
Object
- Object
- BatteryGrowl
- Defined in:
- lib/battery_growl/version.rb,
lib/battery_growl/battery_growl.rb
Constant Summary collapse
- VERSION =
"0.0.1"
Instance Method Summary collapse
-
#initialize ⇒ BatteryGrowl
constructor
A new instance of BatteryGrowl.
- #run(percent = 10, host = 'localhost') ⇒ Object
Constructor Details
#initialize ⇒ BatteryGrowl
Returns a new instance of BatteryGrowl.
5 6 |
# File 'lib/battery_growl/battery_growl.rb', line 5 def initialize end |
Instance Method Details
#run(percent = 10, host = 'localhost') ⇒ Object
8 9 10 11 12 13 14 15 16 17 |
# File 'lib/battery_growl/battery_growl.rb', line 8 def run(percent=10,host='localhost') num_check(percent) battery_usage = check_battery subject = 'バッテリー容量低下' = "残り#{battery_usage}%です。充電してください。" post_growl(subject,,host) if battery_usage <= percent return true rescue => e raise "#{e}" end |