Module: GrowlCar::Configuration
- Included in:
- GrowlCar
- Defined in:
- lib/growl_car/configuration.rb
Instance Attribute Summary collapse
-
#password ⇒ Object
writeonly
Sets the attribute password.
-
#username ⇒ Object
writeonly
Sets the attribute username.
Class Method Summary collapse
-
.boxcar_url ⇒ String
Url for boxcar.io.
-
.keys ⇒ Array
List of keys used for configuration.
Instance Method Summary collapse
-
#configure {|_self| ... } ⇒ Object
Convenience method to allow GrowlCar configuration to be set in a block.
-
#reset! ⇒ Object
Set all configuration values to nil.
Instance Attribute Details
#password=(value) ⇒ Object (writeonly)
Sets the attribute password
3 4 5 |
# File 'lib/growl_car/configuration.rb', line 3 def password=(value) @password = value end |
#username=(value) ⇒ Object (writeonly)
Sets the attribute username
3 4 5 |
# File 'lib/growl_car/configuration.rb', line 3 def username=(value) @username = value end |
Class Method Details
.boxcar_url ⇒ String
Url for boxcar.io
20 21 22 |
# File 'lib/growl_car/configuration.rb', line 20 def boxcar_url "https://boxcar.io/notifications" end |
.keys ⇒ Array
List of keys used for configuration
10 11 12 13 14 15 |
# File 'lib/growl_car/configuration.rb', line 10 def keys @keys ||= [ :username, :password ] end |
Instance Method Details
#configure {|_self| ... } ⇒ Object
Convenience method to allow GrowlCar configuration to be set in a block
28 29 30 31 32 |
# File 'lib/growl_car/configuration.rb', line 28 def configure yield self validate_credentials! self end |
#reset! ⇒ Object
Set all configuration values to nil
35 36 37 38 39 |
# File 'lib/growl_car/configuration.rb', line 35 def reset! GrowlCar::Configuration.keys.each do |key| instance_variable_set(:"@#{key}", nil) end end |