Method: ANN_Anime#initialize

Defined in:
lib/ann_wrapper/ann_objects.rb

#initialize(ann_anime) ⇒ ANN_Anime

initialize and create info methods



55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
# File 'lib/ann_wrapper/ann_objects.rb', line 55

def initialize(ann_anime)
  @ann_anime = ann_anime

  # information available from detail
  @info = Hash.new
  @info[:title]         = "Main title"
  @info[:synopsis]      = "Plot Summary"
  @info[:num_episodes]  = "Number of episodes"
  @info[:genres]        = "Genres"
  @info[:themes]        = "Themes"
  @info[:vintage]       = "Vintage"
  @info[:op_theme]      = "Opening Theme"
  @info[:ed_theme]      = "Ending Theme"

  # create methods
  @info.each do |name, key|
    create_method(name) do 
      info = find_info(key)
      return nil if info.nil?
      info.map do |i|
        i.content
      end
    end
  end

end