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 10 def initialize hash 11 hash.each do |k,v| 12 instance_variable_set :"@#{k}", v 13 end 14 end
parse(appliance, hash)
click to toggle source
# File lib/studio_api/comment.rb 16 def self.parse(appliance, hash) 17 Comment.new hash.merge(:appliance => appliance) 18 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 22 def reply text 23 appliance.post_comment text, :parent => id 24 end