Sha256: 35ff0cace8aeafd55fffc6ed5a33ae2e4269ae10ad4eca9886a7aefb40469c8f

Contents?: true

Size: 251 Bytes

Versions: 3

Compression:

Stored size: 251 Bytes

Contents

class DevTo::Post
  attr_accessor :title, :author, :tags, :url, :comments, :likes, :date, :content

  @@all = []

  def initialize
    self.class.all << self
  end

  def self.find(id)
    self.all[id.to_i-1]
  end

  def self.all
    @@all
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
dev_to-0.1.3 lib/dev_to/post.rb
dev_to-0.1.2 lib/dev_to/post.rb
dev_to-0.1.0 lib/dev_to/post.rb