class DevTo::Post

Attributes

author[RW]
comments[RW]
content[RW]
date[RW]
likes[RW]
tags[RW]
title[RW]
url[RW]

Public Class Methods

all() click to toggle source
# File lib/dev_to/post.rb, line 19
def self.all
  @@all
end
find(id) click to toggle source
# File lib/dev_to/post.rb, line 15
def self.find(id)
  self.all[id.to_i-1]
end
new(attributes_hash) click to toggle source
# File lib/dev_to/post.rb, line 6
def initialize(attributes_hash)
  attributes_hash.each {|attribute, value| self.send(("#{attribute}="), value)}
  self.class.all << self
end

Public Instance Methods

add_post_attributes(attributes_hash) click to toggle source
# File lib/dev_to/post.rb, line 11
def add_post_attributes(attributes_hash)
  attributes_hash.each {|attribute, value| self.send(("#{attribute}="), value)}
end