Module: Pixelletter

Defined in:
lib/pixelletter.rb,
lib/pixelletter/base.rb,
lib/pixelletter/request/request.rb,
lib/pixelletter/request/xml_builder.rb

Defined Under Namespace

Classes: Base, Request, XMLBuilder

Constant Summary collapse

ENDPOINT =
{
  :production => 'https://www.pixelletter.de/xml/index.php',
  :sandbox => 'http://www.fakeweb.test'
}

Class Method Summary collapse

Class Method Details

.endpointObject



14
15
16
17
18
19
20
# File 'lib/pixelletter.rb', line 14

def self.endpoint
  if sandbox?
    Pixelletter::ENDPOINT[:sandbox]
  else
    Pixelletter::ENDPOINT[:production]
  end
end

.load_initial_valuesObject



37
38
39
40
41
42
43
44
45
46
47
# File 'lib/pixelletter.rb', line 37

def self.load_initial_values
  if File.exists?(File.join(File.dirname('../'), "CREDENTIALS"))
    f = File.join(File.dirname('../'), "CREDENTIALS")
    yml = YAML.load(open(f))
    ENV['EMAIL'] = yml['email']
    ENV['PASSWORD'] = yml['password']
  else
    ENV['EMAIL'] = nil
    ENV['PASSWORD'] = nil
  end
end

.sandbox!Object



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

def self.sandbox!
  self.sandbox = true
end

.sandbox=(boolean) ⇒ Object



30
31
32
# File 'lib/pixelletter.rb', line 30

def self.sandbox=(boolean)
  @@sandbox = boolean
end

.sandbox?Boolean

Returns:

  • (Boolean)


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

def self.sandbox?
  @@sandbox
end