Class: Signpost::Endpoint::Action::Context

Inherits:
Object
  • Object
show all
Defined in:
lib/signpost/endpoint/action.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#envObject (readonly)

Returns the value of attribute env.



7
8
9
# File 'lib/signpost/endpoint/action.rb', line 7

def env
  @env
end

#headersObject (readonly)

Returns the value of attribute headers.



7
8
9
# File 'lib/signpost/endpoint/action.rb', line 7

def headers
  @headers
end

#paramsObject (readonly)

Returns the value of attribute params.



7
8
9
# File 'lib/signpost/endpoint/action.rb', line 7

def params
  @params
end

Instance Method Details

#body(text) ⇒ Object



9
10
11
# File 'lib/signpost/endpoint/action.rb', line 9

def body(text)
  @body = [text]
end

#expand(path, data = {}) ⇒ Object



17
18
19
# File 'lib/signpost/endpoint/action.rb', line 17

def expand(path, data={})
  @router.expand(path, data)
end

#resultObject



21
22
23
# File 'lib/signpost/endpoint/action.rb', line 21

def result
  [@status, @headers, @body]
end

#status(code) ⇒ Object



13
14
15
# File 'lib/signpost/endpoint/action.rb', line 13

def status(code)
  @status = code.to_i
end