Class: CoffeeOutside::OverrideFile
- Inherits:
-
Object
- Object
- CoffeeOutside::OverrideFile
- Defined in:
- lib/coffeeoutside/locations.rb
Instance Attribute Summary collapse
-
#location ⇒ Object
readonly
Returns the value of attribute location.
Instance Method Summary collapse
- #delete_file ⇒ Object
-
#initialize(filename = "./override.yaml") ⇒ OverrideFile
constructor
A new instance of OverrideFile.
- #override? ⇒ Boolean
Constructor Details
#initialize(filename = "./override.yaml") ⇒ OverrideFile
Returns a new instance of OverrideFile.
65 66 67 68 69 70 71 72 73 74 |
# File 'lib/coffeeoutside/locations.rb', line 65 def initialize(filename = "./override.yaml") @filename = filename if ::File.exist? @filename @override = true @location = Location.new(YAML.load_file(filename)) else @override = false @location = nil end end |
Instance Attribute Details
#location ⇒ Object (readonly)
Returns the value of attribute location.
63 64 65 |
# File 'lib/coffeeoutside/locations.rb', line 63 def location @location end |
Instance Method Details
#delete_file ⇒ Object
80 81 82 |
# File 'lib/coffeeoutside/locations.rb', line 80 def delete_file ::File.delete @filename end |
#override? ⇒ Boolean
76 77 78 |
# File 'lib/coffeeoutside/locations.rb', line 76 def override? @override end |