class NationBuilder::Endpoint

Public Class Methods

new(name) click to toggle source
# File lib/nationbuilder/endpoint.rb, line 3
def initialize(name)
  @name = name
  @name_to_method = {}
end

Public Instance Methods

[](method_name) click to toggle source
# File lib/nationbuilder/endpoint.rb, line 22
def [](method_name)
  m = @name_to_method[method_name]
  raise InvalidMethod.new(method_name) if m.nil?
  m
end
methods() click to toggle source
# File lib/nationbuilder/endpoint.rb, line 16
def methods
  @methods ||= @name_to_method.keys
end
name() click to toggle source
# File lib/nationbuilder/endpoint.rb, line 8
def name
  @name.downcase.gsub(' ', '_').to_sym
end
register_method(method) click to toggle source
# File lib/nationbuilder/endpoint.rb, line 12
def register_method(method)
  @name_to_method[method.name] = method
end