Class: Papapi::FormResponse

Inherits:
Response show all
Defined in:
lib/papapi/form_response.rb

Constant Summary

Constants inherited from Response

Response::REMOVE_VARS

Instance Attribute Summary

Attributes inherited from Response

#responses

Instance Method Summary collapse

Methods inherited from Response

#initialize, #parsed

Constructor Details

This class inherits a constructor from Papapi::Response

Instance Method Details

#[](key) ⇒ Object



16
17
18
# File 'lib/papapi/form_response.rb', line 16

def [] (key)
  fields[key.to_sym]
end

#fieldsObject



5
6
7
8
9
10
11
12
13
14
# File 'lib/papapi/form_response.rb', line 5

def fields
  unless @fields
    @fields = {}
    self.parsed['fields'].each do |field|
      next if REMOVE_VARS.include? field[0]
      @fields[field[0].to_sym] = field[1]
    end
  end
  @fields
end