Class: Camp::Site
- Inherits:
-
Object
- Object
- Camp::Site
- Defined in:
- lib/camp/site.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#possible_days ⇒ Object
readonly
Returns the value of attribute possible_days.
Instance Method Summary collapse
- #can_reserve?(day) ⇒ Boolean
-
#initialize(name, possible_days) ⇒ Site
constructor
A new instance of Site.
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
#name ⇒ Object (readonly)
Returns the value of attribute name.
3 4 5 |
# File 'lib/camp/site.rb', line 3 def name @name end |
#possible_days ⇒ Object (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
9 10 11 |
# File 'lib/camp/site.rb', line 9 def can_reserve?(day) possible_days.find {|d| d == day} end |