Class: D3api::Artisan

Inherits:
BaseModel show all
Defined in:
lib/d3api/artisan.rb

Constant Summary collapse

ARTISAN_MAPPING =
{
  :slug => 'slug',
  :name => 'name',
  :portrait => 'portrait',
  :training => nil
}

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Request

#get

Methods included from Connection

#connection

Constructor Details

#initialize(region = :us, artisan_type) ⇒ Artisan

Returns a new instance of Artisan.



12
13
14
15
16
17
18
# File 'lib/d3api/artisan.rb', line 12

def initialize(region=:us, artisan_type)
  json_response = find(region, artisan_type)

  values = super json_response

  set_method(values, ARTISAN_MAPPING)
end

Instance Attribute Details

#nameObject

Returns the value of attribute name.



10
11
12
# File 'lib/d3api/artisan.rb', line 10

def name
  @name
end

#portraitObject

Returns the value of attribute portrait.



10
11
12
# File 'lib/d3api/artisan.rb', line 10

def portrait
  @portrait
end

#slugObject

Returns the value of attribute slug.



10
11
12
# File 'lib/d3api/artisan.rb', line 10

def slug
  @slug
end

#trainingObject

Returns the value of attribute training.



10
11
12
# File 'lib/d3api/artisan.rb', line 10

def training
  @training
end