Class: D3api::Follower

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

Constant Summary collapse

FOLLOWER_MAPPINGS =
{
  :slug => 'slug',
  :name => 'name',
  :portrait => 'portrait',
  :active_skills => nil
}

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Request

#get

Methods included from Connection

#connection

Constructor Details

#initialize(region, follower_type) ⇒ Follower

Returns a new instance of Follower.



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

def initialize(region, follower_type)
  json_response = find(region, follower_type)

  values = super json_response

  set_method(values, FOLLOWER_MAPPINGS)
end

Instance Attribute Details

#active_skillsObject

Returns the value of attribute active_skills.



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

def active_skills
  @active_skills
end

#nameObject

Returns the value of attribute name.



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

def name
  @name
end

#portraitObject

Returns the value of attribute portrait.



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

def portrait
  @portrait
end

#slugObject

Returns the value of attribute slug.



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

def slug
  @slug
end