Class: RubyWarrior::Tower

Inherits:
Object
  • Object
show all
Defined in:
lib/ruby_warrior/tower.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(path) ⇒ Tower

Returns a new instance of Tower.



5
6
7
# File 'lib/ruby_warrior/tower.rb', line 5

def initialize(path)
  @path = File.join(File.expand_path('../../../towers/', __FILE__), path)
end

Instance Attribute Details

#pathObject (readonly)

Returns the value of attribute path.



3
4
5
# File 'lib/ruby_warrior/tower.rb', line 3

def path
  @path
end

Instance Method Details

#nameObject Also known as: to_s



9
10
11
# File 'lib/ruby_warrior/tower.rb', line 9

def name
  File.basename(path)
end