class Ryo::Plugin::Subdomain::Base

Attributes

fld[R]

Public Class Methods

discover(fld) click to toggle source
# File lib/ryo/plugin/subdomain/base.rb, line 33
def self.discover(fld)
  new(fld).discover
end
new(fld) click to toggle source
# File lib/ryo/plugin/subdomain/base.rb, line 8
def initialize(fld)
  @fld = fld
end

Public Instance Methods

discover() click to toggle source
# File lib/ryo/plugin/subdomain/base.rb, line 29
def discover
  parse
end
doc() click to toggle source
# File lib/ryo/plugin/subdomain/base.rb, line 21
def doc
  @doc ||= Oga.parse_html(fetch_body)
end
endpoint() click to toggle source
# File lib/ryo/plugin/subdomain/base.rb, line 12
def endpoint
  raise NotImplementedError, "You must implement #{self.class}##{__method__}"
end
fetch_body() click to toggle source
# File lib/ryo/plugin/subdomain/base.rb, line 16
def fetch_body
  res = Client.http.get("#{endpoint}/#{fld}")
  res.body.to_s
end
parse() click to toggle source
# File lib/ryo/plugin/subdomain/base.rb, line 25
def parse
  raise NotImplementedError, "You must implement #{self.class}##{__method__}"
end