Class: Nicovideo::ThumbInfo
- Inherits:
-
Hash
- Object
- Hash
- Nicovideo::ThumbInfo
- Defined in:
- lib/nicovideo/thumbnail.rb
Instance Attribute Summary collapse
-
#tags ⇒ Object
Returns the value of attribute tags.
Instance Method Summary collapse
- #has_tag?(tag) ⇒ Boolean
-
#initialize ⇒ ThumbInfo
constructor
A new instance of ThumbInfo.
- #tag_flatten ⇒ Object
Constructor Details
#initialize ⇒ ThumbInfo
Returns a new instance of ThumbInfo.
55 56 57 |
# File 'lib/nicovideo/thumbnail.rb', line 55 def initialize @tags = {} end |
Instance Attribute Details
#tags ⇒ Object
Returns the value of attribute tags.
54 55 56 |
# File 'lib/nicovideo/thumbnail.rb', line 54 def @tags end |
Instance Method Details
#has_tag?(tag) ⇒ Boolean
59 60 61 62 |
# File 'lib/nicovideo/thumbnail.rb', line 59 def has_tag?(tag) @tag_hash ||= tag_flatten.inject({}) {|tag_hash, temp_tag| tag_hash[temp_tag] = temp_tag} @tag_hash.has_key? tag end |
#tag_flatten ⇒ Object
64 65 66 |
# File 'lib/nicovideo/thumbnail.rb', line 64 def tag_flatten @tag_flatten ||= @tags.values.flatten end |