Module: AbrLookup

Defined in:
lib/abr_lookup.rb,
lib/abr_lookup/lookup.rb,
lib/abr_lookup/server.rb,
lib/abr_lookup/version.rb

Defined Under Namespace

Classes: Lookup, Server

Constant Summary collapse

VERSION =
"0.1.1"

Class Method Summary collapse

Class Method Details

.abn_lookup_uriObject



10
11
12
# File 'lib/abr_lookup.rb', line 10

def self.abn_lookup_uri
  @abn_lookup_url ||= URI.parse("http://abr.business.gov.au/ABRXMLSearchRPC/ABRXMLSearch.asmx/ABRSearchByABN")
end

.config_pathObject

The path to find the configuration file



34
35
36
# File 'lib/abr_lookup.rb', line 34

def self.config_path
  @config_path ||= 'config/abr.yml'
end

.config_path=(path) ⇒ Object

Set the path to the configuration file



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

def self.config_path=(path)
  @config_path = path
end

.configurationObject

The configuration for abn lookup The available options are :guid - the authentication guid abr.business.gov.au/ :path - the path to match when using middleware



22
23
24
# File 'lib/abr_lookup.rb', line 22

def self.configuration
  @configuration ||= setup_config
end

.configuration=(config) ⇒ Object

Set the configuration for the abn lookup The options that are useful are

See Also:



29
30
31
# File 'lib/abr_lookup.rb', line 29

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

.guidObject



14
15
16
# File 'lib/abr_lookup.rb', line 14

def self.guid
  (configuration['guid'] || configuration[:guid]).to_s
end