Class: Covetous::Data::Artisan
- Defined in:
- lib/covetous/data/artisan.rb
Constant Summary collapse
- ARTISAN_TYPES =
%w{blacksmith jeweler}
Instance Attribute Summary
Attributes inherited from Shen
Instance Method Summary collapse
-
#initialize(artisan_type) ⇒ Artisan
constructor
A new instance of Artisan.
Methods inherited from Shen
Constructor Details
#initialize(artisan_type) ⇒ Artisan
Returns a new instance of Artisan.
9 10 11 12 13 14 |
# File 'lib/covetous/data/artisan.rb', line 9 def initialize(artisan_type) raise UnknownArtisanTypeError, "Please only use an artisan type from: #{ARTISAN_TYPES.to_s}" unless ARTISAN_TYPES.include? artisan_type @url = "#{Covetous::Data::BASE_URL}/artisan/#{artisan_type}" super end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Covetous::Shen