Class: Ravelry::Comment
- Inherits:
-
Object
- Object
- Ravelry::Comment
- Defined in:
- lib/ravelry/comment.rb
Overview
Instance Attribute Summary collapse
-
#highlighted_project ⇒ Object
readonly
Returns the value of attribute highlighted_project.
-
#html ⇒ Object
readonly
Returns the value of attribute html.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#user ⇒ Object
readonly
Returns the value of attribute user.
Instance Method Summary collapse
-
#initialize(data) ⇒ Comment
constructor
Creates new ‘Comment` from Ravelry API Pattern Comment attributes.
- #replies ⇒ Object
Constructor Details
#initialize(data) ⇒ Comment
Creates new ‘Comment` from Ravelry API Pattern Comment attributes.
All class variables are readonly.
16 17 18 19 20 21 22 23 |
# File 'lib/ravelry/comment.rb', line 16 def initialize(data) @data = data @user = Ravelry::User.new @user.data = data[:user] @highlighted_project = data[:highlighted_project] @html = data[:html] @id = data[:id] end |
Instance Attribute Details
#highlighted_project ⇒ Object (readonly)
Returns the value of attribute highlighted_project.
10 11 12 |
# File 'lib/ravelry/comment.rb', line 10 def highlighted_project @highlighted_project end |
#html ⇒ Object (readonly)
Returns the value of attribute html.
10 11 12 |
# File 'lib/ravelry/comment.rb', line 10 def html @html end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
10 11 12 |
# File 'lib/ravelry/comment.rb', line 10 def id @id end |
#user ⇒ Object (readonly)
Returns the value of attribute user.
10 11 12 |
# File 'lib/ravelry/comment.rb', line 10 def user @user end |