Module: NgpVan

Defined in:
lib/ngp_van.rb,
lib/ngp_van/error.rb,
lib/ngp_van/client.rb,
lib/ngp_van/default.rb,
lib/ngp_van/request.rb,
lib/ngp_van/version.rb,
lib/ngp_van/response.rb,
lib/ngp_van/connection.rb,
lib/ngp_van/client/codes.rb,
lib/ngp_van/client/notes.rb,
lib/ngp_van/client/users.rb,
lib/ngp_van/client/echoes.rb,
lib/ngp_van/client/events.rb,
lib/ngp_van/client/people.rb,
lib/ngp_van/client/phones.rb,
lib/ngp_van/configuration.rb,
lib/ngp_van/client/signups.rb,
lib/ngp_van/client/stories.rb,
lib/ngp_van/client/locations.rb,
lib/ngp_van/client/event_types.rb,
lib/ngp_van/client/export_jobs.rb,
lib/ngp_van/client/saved_lists.rb,
lib/ngp_van/client/demographics.rb,
lib/ngp_van/client/printed_lists.rb,
lib/ngp_van/response/raise_error.rb,
lib/ngp_van/client/activist_codes.rb,
lib/ngp_van/client/district_fields.rb,
lib/ngp_van/client/minivan_exports.rb,
lib/ngp_van/client/supporter_groups.rb,
lib/ngp_van/client/survey_questions.rb,
lib/ngp_van/client/canvass_responses.rb

Defined Under Namespace

Modules: Connection, Default, Request, Response Classes: BadGateway, BadRequest, Client, ClientError, Configuration, Conflict, Error, Forbidden, GatewayTimeout, InternalServerError, Invalid, InvalidID, MethodNotAllowed, NotAcceptable, NotFound, NotImplemented, RequestEntityTooLarge, RequestTimeout, ServerError, ServiceUnavailable, TooManyRequests, Unauthorized, UnprocessableEntity, UnsupportedMediaType

Constant Summary collapse

MAJOR =

Current major release.

Returns:

  • (Integer)
0
MINOR =

Current minor release.

Returns:

  • (Integer)
11
PATCH =

Current patch level.

Returns:

  • (Integer)
0
VERSION =

Full release version.

Returns:

  • (String)
[MAJOR, MINOR, PATCH].join('.').freeze

Class Method Summary collapse

Class Method Details

.clientObject



13
14
15
# File 'lib/ngp_van.rb', line 13

def client
  @client ||= NgpVan::Client.new
end

.configurationNgpVan::Configuration

The current configuration.



26
27
28
# File 'lib/ngp_van.rb', line 26

def self.configuration
  @configuration ||= Configuration.new
end

.configuration=(config) ⇒ Object

Set new configuration

Parameters:



32
33
34
# File 'lib/ngp_van.rb', line 32

def self.configuration=(config)
  @configuration = config
end

.configure {|config| ... } ⇒ Object

Modify the current configuration “‘ NgpVan.configure do |config|

config.application_name = 'CroninAndSons'
config.api_key = 'af263f2a-86fd-443b-a1b6-f5b7bce8db30|1'

end “‘

Yield Parameters:



44
45
46
# File 'lib/ngp_van.rb', line 44

def self.configure
  yield configuration
end

.method_missing(method_name, *args, &block) ⇒ Object

Delegate methods called on NgpVan to the client.



18
19
20
21
# File 'lib/ngp_van.rb', line 18

def method_missing(method_name, *args, &block)
  return super unless client.respond_to?(method_name)
  client.send(method_name, *args, &block)
end