Class: Defensio

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

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.api_keyObject

Returns the value of attribute api_key.



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

def api_key
  @api_key
end

.api_versionObject

Returns the value of attribute api_version.



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

def api_version
  @api_version
end

.formatObject

Returns the value of attribute format.



3
4
5
# File 'lib/defensio.rb', line 3

def format
  @format
end

.owner_urlObject

Returns the value of attribute owner_url.



7
8
9
# File 'lib/defensio.rb', line 7

def owner_url
  @owner_url
end

.service_typeObject

Returns the value of attribute service_type.



4
5
6
# File 'lib/defensio.rb', line 4

def service_type
  @service_type
end

Class Method Details

.configure(confhash) ⇒ Object



14
15
16
17
18
19
20
21
22
23
24
# File 'lib/defensio.rb', line 14

def self.configure(confhash)
  if confhash['test']
    @mock = true
    self.owner_url = 'http://www.example.com'
    return
  else
    confhash.each do |prop, val|
      self.send("#{prop}=", val)
    end
  end
end

.method_missing(name, *args) ⇒ Object



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

def self.method_missing(name, *args)
  self.post(name.to_s.dasherize, *args)
end