Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add encounters support #16

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion lib/rbattlenet/endpoints/wow/character.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module RBattlenet
module Wow
class Character < RBattlenet::Endpoints::Base
SUPPORTED_FIELDS = [:itself, :achievements, :appearance, :equipment, :hunter_pets, :keystones, :media,
SUPPORTED_FIELDS = [:itself, :achievements, :appearance, :encounters, :equipment, :hunter_pets, :keystones, :media,
:mounts, :pets, :pvp_summary, :reputations, :specializations, :statistics, :status,
:titles]

Expand All @@ -18,6 +18,10 @@ def appearance
RBattlenet::Wow::Character::Appearance
end

def encounters
RBattlenet::Wow::Character::Encounters
end

def equipment
RBattlenet::Wow::Character::Equipment
end
Expand Down
21 changes: 21 additions & 0 deletions lib/rbattlenet/endpoints/wow/character/encounters.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
module RBattlenet
module Wow
class Character::Encounters < RBattlenet::Endpoints::Base
SUPPORTED_FIELDS = [:dungeons, :raids]

class << self
def path(character)
RBattlenet.uri("profile/wow/character/#{character[:realm]}/#{character[:name]}/encounters?namespace=profile-")
end

def dungeons
RBattlenet::Wow::Character::Encounters::Dungeons
end

def raids
RBattlenet::Wow::Character::Encounters::Raids
end
end
end
end
end
9 changes: 9 additions & 0 deletions lib/rbattlenet/endpoints/wow/character/encounters/dungeons.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
module RBattlenet
module Wow
class Character::Encounters::Dungeons < RBattlenet::Endpoints::Base
def self.path(character)
RBattlenet.uri("profile/wow/character/#{character[:realm]}/#{character[:name]}/encounters/dungeons?namespace=profile-")
end
end
end
end
9 changes: 9 additions & 0 deletions lib/rbattlenet/endpoints/wow/character/encounters/raids.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
module RBattlenet
module Wow
class Character::Encounters::Raids < RBattlenet::Endpoints::Base
def self.path(character)
RBattlenet.uri("profile/wow/character/#{character[:realm]}/#{character[:name]}/encounters/raids?namespace=profile-")
end
end
end
end