Class: Northshire_inn
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 = 'Northshire Inn', commands = ['leave', 'look', 'rest']) ⇒ Northshire_inn
constructor
A new instance of Northshire_inn.
- #introduction ⇒ Object
- #leave ⇒ Object
- #look ⇒ Object
Methods included from Inn
Constructor Details
#initialize(name = 'Northshire Inn', commands = ['leave', 'look', 'rest']) ⇒ Northshire_inn
Returns a new instance of Northshire_inn.
44 45 46 47 |
# File 'lib/northshire.rb', line 44 def initialize(name = 'Northshire Inn', commands = ['leave', 'look', 'rest']) @name = name @commands = commands end |
Instance Attribute Details
#commands ⇒ Object
Returns the value of attribute commands.
40 41 42 |
# File 'lib/northshire.rb', line 40 def commands @commands end |
#name ⇒ Object
Returns the value of attribute name.
40 41 42 |
# File 'lib/northshire.rb', line 40 def name @name end |
Instance Method Details
#introduction ⇒ Object
53 54 55 56 57 |
# File 'lib/northshire.rb', line 53 def introduction puts 'You walk into the inn. The interior is just as bleak as the rest of the town.' puts "You see the innkeeper - a sad looking man - who asks if you would like a room." puts "(rest)" end |
#leave ⇒ Object
49 50 51 |
# File 'lib/northshire.rb', line 49 def leave $player.position.delete_at (0) end |
#look ⇒ Object
59 60 61 62 |
# File 'lib/northshire.rb', line 59 def look puts 'You see the innkeeper behind a wooden counter. Their is little light here, but' puts 'enough to see that the walls are bare. There is nothing of any interest here.' end |