Class: CoffeeOutside::RssDispatcher
Instance Attribute Summary
#end_time, #forecast, #location, #start_time
Instance Method Summary
collapse
#debug_method, #initialize, #notify, #production?
Instance Method Details
#generate_description ⇒ Object
8
9
10
11
12
13
|
# File 'lib/coffeeoutside/dispatchers/rss.rb', line 8
def generate_description
items = []
items.append(["Address: #{@location.address}"]) if @location.address
items.append(@forecast)
items.join("\n")
end
|
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
# File 'lib/coffeeoutside/dispatchers/rss.rb', line 15
def
RSS::Maker.make("2.0") do |maker|
maker.channel.language = "en"
maker.channel.author = "CoffeeOutsideBot"
maker.channel.updated = Time.now.to_s
maker.channel.about = "https://coffeeoutside.bike/yyc.rss"
maker.channel.link = "https://coffeeoutside.bike/yyc.rss"
maker.channel.description = "CoffeeOutside is a weekly meetup where Calgarians bike/walk/run/rollerblade to a location, drink coffee/tea/some hot or cold beverage, and shoot the breeze" maker.channel.title = "CoffeeOutside"
maker.items.new_item do |item|
item.link = @location.url if @location.url
item.title = "Location for #{@start_time.strftime("%Y-%m-%d")}: #{@location.name}"
item.description = generate_description
item.updated = Time.now.to_s
end
end
end
|
#notify_debug ⇒ Object
39
40
41
|
# File 'lib/coffeeoutside/dispatchers/rss.rb', line 39
def notify_debug
puts
end
|
#notify_production ⇒ Object
34
35
36
37
|
# File 'lib/coffeeoutside/dispatchers/rss.rb', line 34
def notify_production
i = File.open("yyc.rss", "w")
i.write()
end
|