Sha256: af105fecda46255b0e3a6ebc2dee4e571062bb8dc7d88fe6ff55a0b5e166fde2
Contents?: true
Size: 761 Bytes
Versions: 7
Compression:
Stored size: 761 Bytes
Contents
require 'ostruct' class Post FIXTURES = [{ id: 1, title: "Lorem ipsum whatever", content: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas tempus gravida imperdiet. Pellentesque imperdiet justo quis erat feugiat porttitor. Nulla aliquet neque vitae elit tincidunt in venenatis risus faucibus. Etiam faucibus pretium enim, et rutrum libero feugiat vitae. Donec a lectus vitae est lobortis vulputate. Nulla facilisi. Donec pellentesque pretium lectus, eu volutpat nibh molestie nec." }, { id: 2, title: "Foo bar baz", content: "Foo bar baz qux quux" }] def self.all FIXTURES.map do |f| OpenStruct.new(f) end end def self.find(id) all.find do |f| f.id == id.to_i end end end
Version data entries
7 entries across 7 versions & 1 rubygems