class Accom
Constants
- USER_AGENT
Public Class Methods
Source
# File plugins/accom.rb, line 32 def dispatch_command(text, fetch:, today: nil) parsed = parse_command(text, today: today) return { error: parsed[:error] } if parsed[:error] items = search(parsed, fetch: fetch) search_url = AccomSearch.travel_search_url(parsed) { reply: AccomReport.build_report(items, parsed, search_url: search_url) } end
Source
# File plugins/accom.rb, line 28 def search(parsed, fetch:) AccomSearch.search(parsed, fetch: fetch) end
Public Instance Methods
Source
# File plugins/accom.rb, line 54 def execute(m, args) result = self.class.dispatch_command(args, fetch: method(:fetch_html)) return themed_flood_safe_reply(m, result[:error]) if result[:error] themed_flood_safe_reply(m, result[:reply]) end
Source
# File plugins/accom.rb, line 50 def fetch_html(url) RabbotHttp.fetch(url, user_agent: USER_AGENT) end
Source
# File plugins/accom.rb, line 46 def search(parsed, fetch: method(:fetch_html)) self.class.search(parsed, fetch: fetch) end