Class: BungieSdk::Destiny2::Profile
- Defined in:
- lib/bungie_sdk/profile.rb
Overview
Represents a Destiny2 profile
Constant Summary
Constants inherited from ApiAgent
Instance Attribute Summary
Attributes inherited from ApiAgent
Instance Method Summary collapse
- #characters(components: [DestinyComponentType.Characters]) ⇒ Object
- #membership_id ⇒ Object
- #membership_type ⇒ Object
Methods inherited from ApiAgent
#delete, #get, #initialize, #post, #put, #request, #run
Constructor Details
This class inherits a constructor from BungieSdk::ApiAgent
Instance Method Details
#characters(components: [DestinyComponentType.Characters]) ⇒ Object
11 12 13 14 15 16 |
# File 'lib/bungie_sdk/profile.rb', line 11 def characters(components: [DestinyComponentType.Characters]) characters = run(get(profile_url, params: { components: components.join(',') })).body characters['characters']['data'].map do |_, character| Character.new(character) end end |
#membership_id ⇒ Object
20 21 22 |
# File 'lib/bungie_sdk/profile.rb', line 20 def membership_id data['profile']['data']['userInfo']['membershipId'] end |
#membership_type ⇒ Object
26 27 28 |
# File 'lib/bungie_sdk/profile.rb', line 26 def membership_type data['profile']['data']['userInfo']['membershipType'] end |