Class Defensio::Response
In: lib/defensio/client.rb
Parent: Object

Methods

Attributes

raw  [R] 

Public Class methods

[Source]

    # File lib/defensio/client.rb, line 11
11:     def initialize(response_body)
12:       @raw = response_body
13:       @parameters = YAML.load(response_body)['defensio-result'] || {}
14:     end

[Source]

    # File lib/defensio/client.rb, line 25
25:     def self.response_attr_reader(*attrs)
26:       attrs.each do |attr|
27:         define_method attr do
28:           self[attr]
29:         end
30:       end
31:     end

Public Instance methods

[Source]

    # File lib/defensio/client.rb, line 16
16:     def [](parameter)
17:       @parameters[parameter.to_s.tr('_', '-')]
18:     end

Indicates whether the action could be processed

[Source]

    # File lib/defensio/client.rb, line 21
21:     def success?
22:       self[:status] == 'success'
23:     end

[Validate]