Class: StudioApi::Comment
- Inherits:
-
Object
- Object
- StudioApi::Comment
- Defined in:
- lib/studio_api/comment.rb
Overview
Comment class
Represents comment attached to published appliance in gallery.
Allows to read id, time, commenter name and text of comment together with attached appliance
Instance Attribute Summary collapse
-
#appliance ⇒ Object
readonly
Returns the value of attribute appliance.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#text ⇒ Object
readonly
Returns the value of attribute text.
-
#timestamp ⇒ Object
readonly
Returns the value of attribute timestamp.
-
#username ⇒ Object
readonly
Returns the value of attribute username.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(hash) ⇒ Comment
constructor
A new instance of Comment.
-
#reply(text) ⇒ Object
Post reply to comment with text @param text reply content.
Constructor Details
#initialize(hash) ⇒ Comment
Returns a new instance of Comment.
10 11 12 13 14 |
# File 'lib/studio_api/comment.rb', line 10 def initialize hash hash.each do |k,v| instance_variable_set :"@#{k}", v end end |
Instance Attribute Details
#appliance ⇒ Object (readonly)
Returns the value of attribute appliance.
8 9 10 |
# File 'lib/studio_api/comment.rb', line 8 def appliance @appliance end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
8 9 10 |
# File 'lib/studio_api/comment.rb', line 8 def id @id end |
#text ⇒ Object (readonly)
Returns the value of attribute text.
8 9 10 |
# File 'lib/studio_api/comment.rb', line 8 def text @text end |
#timestamp ⇒ Object (readonly)
Returns the value of attribute timestamp.
8 9 10 |
# File 'lib/studio_api/comment.rb', line 8 def @timestamp end |
#username ⇒ Object (readonly)
Returns the value of attribute username.
8 9 10 |
# File 'lib/studio_api/comment.rb', line 8 def username @username end |
Class Method Details
Instance Method Details
#reply(text) ⇒ Object
Post reply to comment with text @param text reply content
22 23 24 |
# File 'lib/studio_api/comment.rb', line 22 def reply text appliance.post_comment text, :parent => id end |