class StudioApi::Comment

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

Attributes

appliance[R]
id[R]
text[R]
timestamp[R]
username[R]

Public Class Methods

new(hash) click to toggle source
# File lib/studio_api/comment.rb, line 10
def initialize hash
  hash.each do |k,v|
    instance_variable_set :"@#{k}", v
  end
end
parse(appliance, hash) click to toggle source
# File lib/studio_api/comment.rb, line 16
def self.parse(appliance, hash)
  Comment.new hash.merge(:appliance => appliance)
end

Public Instance Methods

reply(text) click to toggle source

Post reply to comment with text @param text reply content

# File lib/studio_api/comment.rb, line 22
def reply text
  appliance.post_comment text, :parent => id
end