class Fappu::Comment

Attributes

attached_id[RW]
date[RW]
id[RW]
poster[RW]
poster_url[RW]
reputation[RW]
text[RW]

Public Class Methods

new(args) click to toggle source
# File lib/fappu/comment.rb, line 6
def initialize args
  comment_args = comment_parameters(args)
  comment_args.each do |k,v|
    instance_variable_set("@#{k}",v) unless v.nil?
  end
end

Private Instance Methods

comment_parameters(comment) click to toggle source
# File lib/fappu/comment.rb, line 15
def comment_parameters(comment)
  params = {
    title: comment["comment_id"],
    attached_id: comment["comment_attached_id"],
    poster: comment["comment_poster"],
    poster_url: comment["comment_poster_url"],
    reputation: comment["comment_reputation"],
    body: comment["comment_text"],
    date: comment["comment_date"]
  }
end