Class: Flash::Integration::Request

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes) ⇒ Request

Returns a new instance of Request.



8
9
10
11
12
13
14
15
# File 'lib/flash/integration/request.rb', line 8

def initialize(attributes)
  @method = attributes.fetch(:method)
  @url = attributes.fetch(:url)
  @params = attributes[:params] || {}
  @headers = attributes[:headers] || {}
  @body = attributes[:body] || {}
  @time = attributes[:time] || Time.now.utc
end

Instance Attribute Details

#bodyObject (readonly)

Returns the value of attribute body.



6
7
8
# File 'lib/flash/integration/request.rb', line 6

def body
  @body
end

#headersObject (readonly)

Returns the value of attribute headers.



6
7
8
# File 'lib/flash/integration/request.rb', line 6

def headers
  @headers
end

#methodObject (readonly)

Returns the value of attribute method.



6
7
8
# File 'lib/flash/integration/request.rb', line 6

def method
  @method
end

#paramsObject (readonly)

Returns the value of attribute params.



6
7
8
# File 'lib/flash/integration/request.rb', line 6

def params
  @params
end

#timeObject (readonly)

Returns the value of attribute time.



6
7
8
# File 'lib/flash/integration/request.rb', line 6

def time
  @time
end

#urlObject (readonly)

Returns the value of attribute url.



6
7
8
# File 'lib/flash/integration/request.rb', line 6

def url
  @url
end