Class: NicoQuery::ObjectMapper::MylistRSS::Item::Description
- Inherits:
-
Object
- Object
- NicoQuery::ObjectMapper::MylistRSS::Item::Description
- Defined in:
- lib/nicoquery/object_mapper/mylist_rss.rb
Instance Attribute Summary collapse
-
#raw_text ⇒ Object
readonly
Returns the value of attribute raw_text.
Instance Method Summary collapse
- #community_references ⇒ Object
-
#initialize(raw_text) ⇒ Description
constructor
A new instance of Description.
- #movie_references ⇒ Object
- #mylist_references ⇒ Object
- #seiga_references ⇒ Object
- #text ⇒ Object
Constructor Details
#initialize(raw_text) ⇒ Description
Returns a new instance of Description.
143 144 145 |
# File 'lib/nicoquery/object_mapper/mylist_rss.rb', line 143 def initialize(raw_text) @raw_text = raw_text.to_s end |
Instance Attribute Details
#raw_text ⇒ Object (readonly)
Returns the value of attribute raw_text.
141 142 143 |
# File 'lib/nicoquery/object_mapper/mylist_rss.rb', line 141 def raw_text @raw_text end |
Instance Method Details
#community_references ⇒ Object
161 162 163 |
# File 'lib/nicoquery/object_mapper/mylist_rss.rb', line 161 def community_references text.scan /co\d{1,}/ end |
#movie_references ⇒ Object
152 153 154 155 |
# File 'lib/nicoquery/object_mapper/mylist_rss.rb', line 152 def movie_references # is this the high road? text.scan(/((sm|nm)\d{1,})/).map {|e| e[0]} end |
#mylist_references ⇒ Object
157 158 159 |
# File 'lib/nicoquery/object_mapper/mylist_rss.rb', line 157 def mylist_references text.scan(/(?<=mylist\/)\d{1,}/).map(&:to_i) end |
#seiga_references ⇒ Object
165 166 167 |
# File 'lib/nicoquery/object_mapper/mylist_rss.rb', line 165 def seiga_references text.scan /im\d{1,}/ end |
#text ⇒ Object
147 148 149 150 |
# File 'lib/nicoquery/object_mapper/mylist_rss.rb', line 147 def text @raw_text.scan /(?<=class\=\"nico\-description\"\>).{1,}(?=\<\/p\>)/ $& end |