Class: Alf::Rest::Request
- Inherits:
-
Rack::Request
- Object
- Rack::Request
- Alf::Rest::Request
- Defined in:
- lib/alf/rest/request.rb
Instance Attribute Summary collapse
-
#heading ⇒ Object
readonly
Returns the value of attribute heading.
Instance Method Summary collapse
-
#initialize(env, heading) ⇒ Request
constructor
A new instance of Request.
- #to_relation ⇒ Object
- #to_tuple ⇒ Object
Constructor Details
#initialize(env, heading) ⇒ Request
Returns a new instance of Request.
5 6 7 8 |
# File 'lib/alf/rest/request.rb', line 5 def initialize(env, heading) super(env) @heading = Heading.coerce(heading) end |
Instance Attribute Details
#heading ⇒ Object (readonly)
Returns the value of attribute heading.
9 10 11 |
# File 'lib/alf/rest/request.rb', line 9 def heading @heading end |
Instance Method Details
#to_relation ⇒ Object
11 12 13 14 15 |
# File 'lib/alf/rest/request.rb', line 11 def to_relation relation = Relation.coerce(each.to_a) commons = heading.to_attr_list & relation.heading.to_attr_list relation.project(commons).coerce(heading.project(commons)) end |
#to_tuple ⇒ Object
17 18 19 |
# File 'lib/alf/rest/request.rb', line 17 def to_tuple to_relation.tuple_extract end |