Class: HackerCurse::ForumComment

Inherits:
Object
  • Object
show all
Defined in:
lib/hacker/curse/abstractsiteparser.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(h) ⇒ ForumComment

Returns a new instance of ForumComment.



95
96
97
98
99
100
101
102
# File 'lib/hacker/curse/abstractsiteparser.rb', line 95

def initialize h

  @hash = h
[:points, :comment_url, :age_text, :age,
:submitter, :submitter_url, :comment_text, :head].each do |sym|
  instance_variable_set("@#{sym.to_s}", h[sym])
end
end

Instance Attribute Details

#ageObject

Returns the value of attribute age.



91
92
93
# File 'lib/hacker/curse/abstractsiteparser.rb', line 91

def age
  @age
end

#age_textObject

Returns the value of attribute age_text.



91
92
93
# File 'lib/hacker/curse/abstractsiteparser.rb', line 91

def age_text
  @age_text
end

#comment_textObject

Returns the value of attribute comment_text.



92
93
94
# File 'lib/hacker/curse/abstractsiteparser.rb', line 92

def comment_text
  @comment_text
end

#comment_urlObject

Returns the value of attribute comment_url.



93
94
95
# File 'lib/hacker/curse/abstractsiteparser.rb', line 93

def comment_url
  @comment_url
end

#hashObject (readonly)

Returns the value of attribute hash.



94
95
96
# File 'lib/hacker/curse/abstractsiteparser.rb', line 94

def hash
  @hash
end

#headObject

Returns the value of attribute head.



91
92
93
# File 'lib/hacker/curse/abstractsiteparser.rb', line 91

def head
  @head
end

#pointsObject

Returns the value of attribute points.



91
92
93
# File 'lib/hacker/curse/abstractsiteparser.rb', line 91

def points
  @points
end

#submitterObject

Returns the value of attribute submitter.



90
91
92
# File 'lib/hacker/curse/abstractsiteparser.rb', line 90

def submitter
  @submitter
end

#submitter_urlObject

Returns the value of attribute submitter_url.



90
91
92
# File 'lib/hacker/curse/abstractsiteparser.rb', line 90

def submitter_url
  @submitter_url
end

Instance Method Details

#[](sym) ⇒ Object



103
104
105
# File 'lib/hacker/curse/abstractsiteparser.rb', line 103

def [](sym)
  @hash[sym]
end

#keysObject



106
107
108
# File 'lib/hacker/curse/abstractsiteparser.rb', line 106

def keys
  @hash.keys
end

#valuesObject



109
110
111
# File 'lib/hacker/curse/abstractsiteparser.rb', line 109

def values
  @hash.values
end