-
-
Notifications
You must be signed in to change notification settings - Fork 392
Expand file tree
/
Copy pathsample_story.rb
More file actions
80 lines (68 loc) · 2.16 KB
/
Copy pathsample_story.rb
File metadata and controls
80 lines (68 loc) · 2.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
# frozen_string_literal: true
SAMPLE_BODY = <<~HTML
<p>Tofu shoreditch intelligentsia <a href="#">umami</a>, fashion axe photo booth
try-hard terry richardson quinoa actually fingerstache meggings fixie. Aesthetic
salvia vinyl raw denim, keffiyeh master cleanse tonx selfies mlkshk occupy twee
street art gentrify. Quinoa PBR readymade 90's. <b>Chambray</b> Austin aesthetic
meggings, carles vinyl intelligentsia tattooed. Keffiyeh mumblecore
fingerstache, sartorial sriracha disrupt biodiesel cred. Skateboard yr cosby
sweater, narwhal beard ethnic jean shorts aesthetic. Post-ironic flannel mlkshk,
pickled VHS wolf banjo forage portland wayfarers.</p>
<img src='https://placekitten.com/g/500/300' />
<p>Selfies mumblecore odd future <a href="#">irony DIY messenger bag</a>.
Authentic neutra next level selvage squid. Four loko freegan occupy, tousled
vinyl leggings selvage messenger bag. Four loko wayfarers kale chips, next level
banksy banh mi umami flannel hella. Street art odd future scenester,
intelligentsia brunch fingerstache YOLO narwhal single-origin coffee tousled
tumblr pop-up four loko you probably haven't heard of them dreamcatcher.
Single-origin coffee direct trade retro biodiesel, truffaut fanny pack portland
blue bottle scenester bushwick. Skateboard squid fanny pack bushwick, photo
booth vice literally.</p>
HTML
SampleStory =
Struct.new(:source, :title, :lead, :is_read, :published) do
def id
rand(100) * -1
end
def headline
title
end
def permalink
"#"
end
def enclosure_url; end
def lead
"Tofu shoreditch intelligentsia umami, fashion axe photo booth try-hard"
end
def body
SAMPLE_BODY
end
def is_read
false
end
def keep_unread
false
end
def is_starred
false
end
def published
Time.now
end
def as_json(_options = {})
{
id:,
headline:,
lead:,
source:,
title:,
pretty_date: published.strftime("%A, %B %d"),
body:,
enclosure_url:,
permalink:,
is_read:,
is_starred:,
keep_unread:
}
end
end