Class: Comment

Inherits:
Object
  • Object
show all
Defined in:
lib/Rubbit/Rubbit_Objects.rb

Instance Method Summary collapse

Constructor Details

#initialize(json) ⇒ Comment

Returns a new instance of Comment.



192
193
194
195
196
197
198
199
200
# File 'lib/Rubbit/Rubbit_Objects.rb', line 192

def initialize(json)
  if(json['kind']=='t1')
    data = json['data']
    data.each_key do |k|
      self.class.module_eval {attr_accessor(k)}
      self.send("#{k}=",data[k])
    end
  end
end

Instance Method Details

#reply(text) ⇒ Object



202
203
204
# File 'lib/Rubbit/Rubbit_Objects.rb', line 202

def reply(text)
  Rubbit_Poster.instance.comment(text,@name)
end