Class: CoffeeOutside::OverrideFile

Inherits:
Object
  • Object
show all
Defined in:
lib/coffeeoutside/locations.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#locationObject (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_fileObject



80
81
82
# File 'lib/coffeeoutside/locations.rb', line 80

def delete_file
  ::File.delete @filename
end

#override?Boolean

Returns:

  • (Boolean)


76
77
78
# File 'lib/coffeeoutside/locations.rb', line 76

def override?
  @override
end