Class: Camp::Site

Inherits:
Object
  • Object
show all
Defined in:
lib/camp/site.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, possible_days) ⇒ Site

Returns a new instance of Site.



4
5
6
7
# File 'lib/camp/site.rb', line 4

def initialize(name, possible_days)
  @name = name
  @possible_days = possible_days
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



3
4
5
# File 'lib/camp/site.rb', line 3

def name
  @name
end

#possible_daysObject (readonly)

Returns the value of attribute possible_days.



3
4
5
# File 'lib/camp/site.rb', line 3

def possible_days
  @possible_days
end

Instance Method Details

#can_reserve?(day) ⇒ Boolean

Returns:

  • (Boolean)


9
10
11
# File 'lib/camp/site.rb', line 9

def can_reserve?(day)
  possible_days.find {|d| d == day}
end