Sha256: 2ebfc02549e54e7fc259f9d04b1345bde3f78291060cccdc872f71f6042fb8c6

Contents?: true

Size: 1.02 KB

Versions: 1

Compression:

Stored size: 1.02 KB

Contents

module Jikan
  class Character < BaseEntity
    def mal_id
      raw['mal_id']
    end

    def url
      raw['url']
    end
    
    def name
      raw['name']
    end

    def image_url
      raw['image_url']
    end

    def name_kanji
      raw['name_kanji']
    end

    def nicknames
      raw['nicknames']
    end

    def about
      raw['about']
    end

    def member_fav
      raw['member_favorites']
    end

    def animeography
      raw['animeography'].map do |a|
        Jikan::BasicAnime.new(a)
      end
    end

    def mangaography
      raw['mangaography'].map do |m|
        Jikan::BasicManga.new(m)
      end
    end

    def va
      raw['voice_actors'].map do |va|
				Jikan::VoiceActor.new(va)
			end
    end
  end
  
  class BasicCharacter < Entityography; end

  class CharacterResult < BasicCharacter
    def alternative_names
      raw['alternative_names']
    end

    def details(flag=nil)
      Jikan::character_id id, flag
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
jikan.rb-0.0.7 lib/jikan/models/character.rb