Module: LDA

Defined in:
lib/lda_gov.rb,
lib/lda_gov/error.rb,
lib/lda_gov/client.rb,
lib/lda_gov/version.rb,
lib/lda_gov/response.rb,
lib/lda_gov/configuration.rb,
lib/lda_gov/resources/base.rb,
lib/lda_gov/resources/clients.rb,
lib/lda_gov/resources/filings.rb,
lib/lda_gov/resources/constants.rb,
lib/lda_gov/resources/lobbyists.rb,
lib/lda_gov/resources/registrants.rb,
lib/lda_gov/resources/contributions.rb

Defined Under Namespace

Modules: Resources Classes: BadRequestError, Client, ClientError, Configuration, ConnectionError, Error, NotFoundError, RateLimitError, Response, ServerError, UnauthorizedError, UnprocessableEntityError

Constant Summary collapse

VERSION =
'0.2.1'

Class Method Summary collapse

Class Method Details

.clientObject



35
36
37
# File 'lib/lda_gov.rb', line 35

def client
  @mutex.synchronize { @client ||= Client.new(@configuration || Configuration.new) }
end

.clientsObject



51
52
53
# File 'lib/lda_gov.rb', line 51

def clients
  Resources::Clients.new(client)
end

.configurationObject



20
21
22
# File 'lib/lda_gov.rb', line 20

def configuration
  @mutex.synchronize { @configuration ||= Configuration.new }
end

.configureObject



24
25
26
# File 'lib/lda_gov.rb', line 24

def configure
  @mutex.synchronize { yield(@configuration ||= Configuration.new) }
end

.constantsObject



59
60
61
# File 'lib/lda_gov.rb', line 59

def constants
  Resources::Constants.new(client)
end

.contributionsObject



43
44
45
# File 'lib/lda_gov.rb', line 43

def contributions
  Resources::Contributions.new(client)
end

.filingsObject



39
40
41
# File 'lib/lda_gov.rb', line 39

def filings
  Resources::Filings.new(client)
end

.lobbyistsObject



55
56
57
# File 'lib/lda_gov.rb', line 55

def lobbyists
  Resources::Lobbyists.new(client)
end

.registrantsObject



47
48
49
# File 'lib/lda_gov.rb', line 47

def registrants
  Resources::Registrants.new(client)
end

.reset!Object



28
29
30
31
32
33
# File 'lib/lda_gov.rb', line 28

def reset!
  @mutex.synchronize do
    @configuration = Configuration.new
    @client = nil
  end
end