Class: Easytobookr::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/easytobookr/config.rb

Constant Summary collapse

DEFAULTS =
{
  :test => {
    :endpoint => 'http://testnl.etbxml.com/webservice/server_v21.php',
    :username => 'affiliate',
    :password => 'affiliate',
    :campaignid => '1'
  },
  :production => {
    :endpoint => 'https://www.etbxml.com/webservice/server_v21.php'
  }
}.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfig

Returns a new instance of Config.



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

def initialize
  self.env = :test
end

Instance Attribute Details

#campaignidObject

Returns the value of attribute campaignid.



6
7
8
# File 'lib/easytobookr/config.rb', line 6

def campaignid
  @campaignid
end

#endpointObject

Returns the value of attribute endpoint.



6
7
8
# File 'lib/easytobookr/config.rb', line 6

def endpoint
  @endpoint
end

#envObject

Returns the value of attribute env.



5
6
7
# File 'lib/easytobookr/config.rb', line 5

def env
  @env
end

#passwordObject

Returns the value of attribute password.



6
7
8
# File 'lib/easytobookr/config.rb', line 6

def password
  @password
end

#usernameObject

Returns the value of attribute username.



6
7
8
# File 'lib/easytobookr/config.rb', line 6

def username
  @username
end

Instance Method Details

#uriObject



36
37
38
# File 'lib/easytobookr/config.rb', line 36

def uri
  URI.parse(endpoint)
end