Class: Jikanrb::Resources::CharacterResource
- Inherits:
-
BaseResource
- Object
- BaseResource
- Jikanrb::Resources::CharacterResource
- Defined in:
- lib/jikanrb/resources/character_resource.rb
Overview
Resource class for accessing Character sub-resources from the Jikan API. Provides fluent API access to character details, anime appearances, manga appearances, voice actors, and pictures.
Instance Attribute Summary
Attributes inherited from BaseResource
Instance Method Summary collapse
-
#animes ⇒ Hash
Returns anime appearances for this character.
-
#info(full: false) ⇒ Hash
Returns character details.
-
#mangas ⇒ Hash
Returns manga appearances for this character.
-
#pictures ⇒ Hash
Returns pictures of this character.
-
#voices ⇒ Hash
Returns voice actors for this character.
Methods inherited from BaseResource
Constructor Details
This class inherits a constructor from Jikanrb::Resources::BaseResource
Instance Method Details
#animes ⇒ Hash
Returns anime appearances for this character
44 45 46 |
# File 'lib/jikanrb/resources/character_resource.rb', line 44 def animes get("characters/#{@id}/anime") end |
#info(full: false) ⇒ Hash
Returns character details
32 33 34 35 |
# File 'lib/jikanrb/resources/character_resource.rb', line 32 def info(full: false) path = full ? "characters/#{@id}/full" : "characters/#{@id}" get(path) end |
#mangas ⇒ Hash
Returns manga appearances for this character
55 56 57 |
# File 'lib/jikanrb/resources/character_resource.rb', line 55 def mangas get("characters/#{@id}/manga") end |
#pictures ⇒ Hash
Returns pictures of this character
77 78 79 |
# File 'lib/jikanrb/resources/character_resource.rb', line 77 def pictures get("characters/#{@id}/pictures") end |
#voices ⇒ Hash
Returns voice actors for this character
66 67 68 |
# File 'lib/jikanrb/resources/character_resource.rb', line 66 def voices get("characters/#{@id}/voices") end |