class Url2Event::Base

Attributes

implementations[RW]
options[RW]

Public Class Methods

inherited(subclass) click to toggle source
# File lib/url_2_event/base.rb, line 9
def inherited(subclass)
  subclass.class_eval do
    include HTTParty
  end
  @implementations << subclass unless @implementations.include?(subclass)
end
is_parser_for?() click to toggle source
# File lib/url_2_event/base.rb, line 16
def is_parser_for?
  raise NotImplementedError, "You should define #{self.class}.#{__method__}."
end
new(uri) click to toggle source
# File lib/url_2_event/base.rb, line 21
def initialize(uri)
  @uri = uri
end

Public Instance Methods

event_endpoint() click to toggle source
# File lib/url_2_event/base.rb, line 38
def event_endpoint
  raise NotImplementedError, "You should define #{self.class}##{__method__}."
end
get_event() click to toggle source
# File lib/url_2_event/base.rb, line 25
def get_event
  response = self.class.get(event_endpoint, options)
  to_event(response)
end
sanitize(raw) click to toggle source
# File lib/url_2_event/base.rb, line 30
def sanitize(raw)
  Rails::Html::FullSanitizer.new().sanitize(raw)
end
to_event() click to toggle source
# File lib/url_2_event/base.rb, line 34
def to_event
  raise NotImplementedError, "You should define #{self.class}##{__method__}."
end