class RecurlyEvent::Namespace

Constants

RESOURCES_REGEXP

Public Instance Methods

parse_with_namespace(name) click to toggle source
# File lib/recurly_event/namespace.rb, line 9
def parse_with_namespace(name)
  with_namespace(parse_name(name))
end
regexp_wrap(name) click to toggle source
# File lib/recurly_event/namespace.rb, line 13
def regexp_wrap(name)
  /^#{Regexp.escape(with_namespace(name))}/
end
with_namespace(name) click to toggle source
# File lib/recurly_event/namespace.rb, line 5
def with_namespace(name)
  "#{namespace}#{delimeter}#{name}"
end

Private Instance Methods

parse_name(name) click to toggle source
# File lib/recurly_event/namespace.rb, line 19
def parse_name(name)
  noun = RESOURCES_REGEXP.match(name).to_s
  splitted = name.gsub("#{noun}_", "").split("_")
  splitted.pop
  verb = splitted.join("_")
  "#{noun}.#{verb}"
end