Class: CoffeeOutside::LocationFile

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(filename = "./locations.yaml") ⇒ LocationFile

Returns a new instance of LocationFile.



52
53
54
55
56
57
58
59
# File 'lib/coffeeoutside/locations.rb', line 52

def initialize(filename = "./locations.yaml")
  y = YAML.load_file(filename)
  @locations = []
  y.each do |l|
    @locations.append Location.new(l)
  end
  @locations # rubocop:disable Lint/Void
end

Instance Attribute Details

#locationsObject (readonly)

Returns the value of attribute locations.



50
51
52
# File 'lib/coffeeoutside/locations.rb', line 50

def locations
  @locations
end