Class: MddltnInn
Instance Attribute Summary collapse
-
#commands ⇒ Object
Returns the value of attribute commands.
-
#name ⇒ Object
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(name = 'Middleton Inn', commands = ['leave', 'look', 'rest']) ⇒ MddltnInn
constructor
A new instance of MddltnInn.
- #introduction ⇒ Object
- #leave ⇒ Object
- #look ⇒ Object
Methods included from Inn
Constructor Details
#initialize(name = 'Middleton Inn', commands = ['leave', 'look', 'rest']) ⇒ MddltnInn
Returns a new instance of MddltnInn.
75 76 77 78 |
# File 'lib/middleton.rb', line 75 def initialize(name = 'Middleton Inn', commands = ['leave', 'look', 'rest']) @name = name @commands = commands end |
Instance Attribute Details
#commands ⇒ Object
Returns the value of attribute commands.
71 72 73 |
# File 'lib/middleton.rb', line 71 def commands @commands end |
#name ⇒ Object
Returns the value of attribute name.
71 72 73 |
# File 'lib/middleton.rb', line 71 def name @name end |
Instance Method Details
#introduction ⇒ Object
84 85 86 87 |
# File 'lib/middleton.rb', line 84 def introduction puts 'You walk into the inn. The Innkeeper looks at you and offers her welcome and' 'asks if she can offer you a room. (rest)' end |
#leave ⇒ Object
80 81 82 |
# File 'lib/middleton.rb', line 80 def leave $player.position.delete_at (0) end |
#look ⇒ Object
89 90 91 92 93 |
# File 'lib/middleton.rb', line 89 def look puts 'You see the innkeeper behind a wooden counter. Various paintings of landscapes' puts 'Hang from the wall and there is a large vase filled with some colorful flowers' puts 'off in the corner. There is nothing of any interest here.' end |