Class: MddltnInn

Inherits:
Object
  • Object
show all
Includes:
Inn
Defined in:
lib/middleton.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Inn

#rest

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

#commandsObject

Returns the value of attribute commands.



71
72
73
# File 'lib/middleton.rb', line 71

def commands
  @commands
end

#nameObject

Returns the value of attribute name.



71
72
73
# File 'lib/middleton.rb', line 71

def name
  @name
end

Instance Method Details

#introductionObject



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

#leaveObject



80
81
82
# File 'lib/middleton.rb', line 80

def leave
	$player.position.delete_at (0)
end

#lookObject



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