Class: ANN_Manga
- Defined in:
- lib/ann_wrapper/ann_manga.rb
Instance Attribute Summary collapse
-
#ann_manga ⇒ Object
writeonly
ann_anime Nokogiri object.
Instance Method Summary collapse
-
#find_info(key) ⇒ Nokogiri::XML::NodeSet
Return all info with provided key.
-
#id ⇒ String
Returns manga id.
-
#initialize(ann_manga) ⇒ ANN_Manga
constructor
A new instance of ANN_Manga.
-
#num_pages ⇒ [String]
Returns the number of tankoubon.
-
#num_tankoubon ⇒ [String]
Returns the number of tankoubon.
-
#ratings ⇒ [ANN_Rating]
Returns array of ANN_Episode.
-
#staff ⇒ [ANN_Staff]
Returns array of ANN_Staff.
-
#to_h ⇒ Hash
Hash of self.
-
#type ⇒ String
Returns manga type.
Methods inherited from ANN_Media
#alt_titles, #create_methods, #genres, #images, #synopsis, #themes, #title, #vintage
Constructor Details
#initialize(ann_manga) ⇒ ANN_Manga
Returns a new instance of ANN_Manga.
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/ann_wrapper/ann_manga.rb', line 7 def initialize(ann_manga) @ann_manga = ann_manga # information available from detail @info = Hash.new @info[:title] = "Main title" @info[:synopsis] = "Plot Summary" @info[:genres] = "Genres" @info[:vintage] = "Vintage" @info[:themes] = "Themes" @info[:num_tankoubon] = "Number of tankoubon" @info[:num_pages] = "Number of pages" # create methods create_methods(@ann_manga, @info) end |
Instance Attribute Details
#ann_manga=(value) ⇒ Object (writeonly)
ann_anime Nokogiri object
5 6 7 |
# File 'lib/ann_wrapper/ann_manga.rb', line 5 def ann_manga=(value) @ann_manga = value end |
Instance Method Details
#find_info(key) ⇒ Nokogiri::XML::NodeSet
Return all info with provided key
25 26 27 |
# File 'lib/ann_wrapper/ann_manga.rb', line 25 def find_info(key) super(@ann_manga, key) end |
#id ⇒ String
Returns manga id
30 31 32 |
# File 'lib/ann_wrapper/ann_manga.rb', line 30 def id @id ||= @ann_manga['id'] end |
#num_pages ⇒ [String]
Returns the number of tankoubon
62 |
# File 'lib/ann_wrapper/ann_manga.rb', line 62 def num_pages; end |
#num_tankoubon ⇒ [String]
Returns the number of tankoubon
59 |
# File 'lib/ann_wrapper/ann_manga.rb', line 59 def num_tankoubon; end |
#ratings ⇒ [ANN_Rating]
Returns array of ANN_Episode
45 46 47 |
# File 'lib/ann_wrapper/ann_manga.rb', line 45 def super @ann_manga end |
#staff ⇒ [ANN_Staff]
Returns array of ANN_Staff
40 41 42 |
# File 'lib/ann_wrapper/ann_manga.rb', line 40 def staff super @ann_manga end |
#to_h ⇒ Hash
Returns hash of self.
50 51 52 53 |
# File 'lib/ann_wrapper/ann_manga.rb', line 50 def to_h # create hash excluding some methods to_hash([:to_h, :ann_manga=, :find_info]) end |
#type ⇒ String
Returns manga type
35 36 37 |
# File 'lib/ann_wrapper/ann_manga.rb', line 35 def type @type ||= @ann_manga['type'] end |