Class: Request

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(hash) ⇒ Request

Returns a new instance of Request.



4
5
6
7
8
9
10
11
12
13
# File 'lib/request.rb', line 4

def initialize(hash)
  @name = hash[:name] || hash['name'] || ''
  @path = hash[:path] || hash['path'] || ''
  @method = hash[:method] || hash['method'] || ''

  @headers = hash[:headers] || hash['headers'] || {}
  @variables = hash[:vars] || hash['vars'] || {}
  @data = hash[:data] || hash['data'] || nil

end

Instance Attribute Details

#dataObject

Returns the value of attribute data.



2
3
4
# File 'lib/request.rb', line 2

def data
  @data
end

#headersObject

Returns the value of attribute headers.



2
3
4
# File 'lib/request.rb', line 2

def headers
  @headers
end

#methodObject

Returns the value of attribute method.



2
3
4
# File 'lib/request.rb', line 2

def method
  @method
end

#nameObject

Returns the value of attribute name.



2
3
4
# File 'lib/request.rb', line 2

def name
  @name
end

#pathObject

Returns the value of attribute path.



2
3
4
# File 'lib/request.rb', line 2

def path
  @path
end

#variablesObject

Returns the value of attribute variables.



2
3
4
# File 'lib/request.rb', line 2

def variables
  @variables
end