Class: Mangdown::PopularManga
- Inherits:
-
Object
- Object
- Mangdown::PopularManga
- Includes:
- Enumerable, Equality
- Defined in:
- lib/mangdown/popular.rb
Instance Attribute Summary collapse
-
#mangas ⇒ Object
readonly
Returns the value of attribute mangas.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#uri ⇒ Object
readonly
Returns the value of attribute uri.
Instance Method Summary collapse
-
#each ⇒ Object
iterate over mangas (for enumerable).
-
#initialize(uri, num_mangas = 30, name = "My Pop Manga") ⇒ PopularManga
constructor
A new instance of PopularManga.
Methods included from Equality
Constructor Details
#initialize(uri, num_mangas = 30, name = "My Pop Manga") ⇒ PopularManga
8 9 10 11 12 13 14 15 |
# File 'lib/mangdown/popular.rb', line 8 def initialize(uri, num_mangas = 30, name = "My Pop Manga") @uri = uri @num_mangas = num_mangas @name = name @mangas = [] get_mangas_list end |
Instance Attribute Details
#mangas ⇒ Object (readonly)
Returns the value of attribute mangas.
6 7 8 |
# File 'lib/mangdown/popular.rb', line 6 def mangas @mangas end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
6 7 8 |
# File 'lib/mangdown/popular.rb', line 6 def name @name end |
#uri ⇒ Object (readonly)
Returns the value of attribute uri.
6 7 8 |
# File 'lib/mangdown/popular.rb', line 6 def uri @uri end |
Instance Method Details
#each ⇒ Object
iterate over mangas (for enumerable)
18 19 20 |
# File 'lib/mangdown/popular.rb', line 18 def each @mangas.each {|manga| yield(manga) if block_given?} end |