Sha256: b946df1164621a6781b58d06f095fe919c43ea6b493116a25547c93dc5ece9f4

Contents?: true

Size: 366 Bytes

Versions: 2

Compression:

Stored size: 366 Bytes

Contents

class NationBuilder::Endpoint

  def initialize(name)
    @name = name
    @name_to_method = {}
  end

  def name
    @name.downcase.gsub(' ', '_').to_sym
  end

  def register_method(method)
    @name_to_method[method.name] = method
  end

  def methods
    @methods ||= @name_to_method.keys
  end

  def [](method_name)
    @name_to_method[method_name]
  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
nationbuilder-rb-0.0.2 lib/nationbuilder/endpoint.rb
nationbuilder-rb-0.0.1 lib/nationbuilder/endpoint.rb