Class: Covetous::Data::Artisan

Inherits:
Shen
  • Object
show all
Defined in:
lib/covetous/data/artisan.rb

Constant Summary collapse

ARTISAN_TYPES =
%w{blacksmith jeweler}

Instance Attribute Summary

Attributes inherited from Shen

#response, #url

Instance Method Summary collapse

Methods inherited from Shen

#method_missing

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