Class: Shinybooru::Post
- Inherits:
-
Object
- Object
- Shinybooru::Post
- Defined in:
- lib/shinybooru.rb
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.
77 78 79 80 81 82 83 84 85 86 87 88 |
# File 'lib/shinybooru.rb', line 77 def initialize (nokogiri_data) @data = Hash.new nokogiri_data.attribute_nodes.each do |node| unless node.name == "tags" @data[node.name.to_sym] = node.value end if node.name == "tags" # so the tags are a list @data[node.name.to_sym] = node.value.split " " end data end end |
Instance Attribute Details
#data ⇒ Object (readonly)
Returns the value of attribute data.
76 77 78 |
# File 'lib/shinybooru.rb', line 76 def data @data end |