Class: Shinybooru::Post
- Inherits:
-
Object
- Object
- Shinybooru::Post
- Defined in:
- lib/shinybooru.rb
Overview
Used internally
Instance Attribute Summary collapse
-
#data ⇒ Object
readonly
Returns the value of attribute data.
Instance Method Summary collapse
-
#initialize(nokogiri_data) ⇒ Post
constructor
A new instance of Post.
Constructor Details
#initialize(nokogiri_data) ⇒ Post
Returns a new instance of Post.
87 88 89 90 91 92 93 94 95 96 97 98 |
# File 'lib/shinybooru.rb', line 87 def initialize(nokogiri_data) @data = {} nokogiri_data.attribute_nodes.each do |node| @data[node.name.to_sym] = if node.name == 'tags' # so that the tags are a list node.value.split ' ' else node.value end data end end |
Instance Attribute Details
#data ⇒ Object (readonly)
Returns the value of attribute data.
86 87 88 |
# File 'lib/shinybooru.rb', line 86 def data @data end |