Class: Horseman::Response

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(body) ⇒ Response

Returns a new instance of Response.



21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# File 'lib/horseman/response.rb', line 21

def initialize(body)
  @body = body
  @forms = []
  
  @field_types = {
    'text' => :text,
    'checkbox' => :checkbox,
    'hidden' => :hidden,
    'submit' => :submit
  }
  
  @encoding_types = {
    'application/x-www-form-urlencoded' => :url,
    'multipart/form-data' => :multipart
  }
  parse
end

Instance Attribute Details

#bodyObject (readonly)

Returns the value of attribute body.



19
20
21
# File 'lib/horseman/response.rb', line 19

def body
  @body
end

#formsObject (readonly)

Returns the value of attribute forms.



19
20
21
# File 'lib/horseman/response.rb', line 19

def forms
  @forms
end