Class: ROM::HTTP::Relation
- Inherits:
-
Relation
- Object
- Relation
- ROM::HTTP::Relation
- Includes:
- ROM::HTTP
- Defined in:
- lib/rom/http/relation.rb
Overview
HTTP-specific relation extensions
Constant Summary
Constants included from ROM::HTTP
Instance Method Summary collapse
- #delete ⇒ Object
- #exclude(*names) ⇒ Object
- #insert(*tuples) ⇒ Object (also: #<<)
- #prefix(prefix) ⇒ Object
- #primary_key ⇒ Object
- #project(*names) ⇒ Object
- #rename(mapping) ⇒ Object
- #update(*tuples) ⇒ Object
Instance Method Details
#delete ⇒ Object
61 62 63 |
# File 'lib/rom/http/relation.rb', line 61 def delete dataset.delete end |
#exclude(*names) ⇒ Object
37 38 39 |
# File 'lib/rom/http/relation.rb', line 37 def exclude(*names) with(schema: schema.exclude(*names)) end |
#insert(*tuples) ⇒ Object Also known as: <<
50 51 52 |
# File 'lib/rom/http/relation.rb', line 50 def insert(*tuples) dataset.insert(*tuples.map { |t| input_schema[t] }) end |
#prefix(prefix) ⇒ Object
45 46 47 |
# File 'lib/rom/http/relation.rb', line 45 def prefix(prefix) with(schema: schema.prefix(prefix)) end |
#primary_key ⇒ Object
29 30 31 |
# File 'lib/rom/http/relation.rb', line 29 def primary_key schema.primary_key_name end |
#project(*names) ⇒ Object
33 34 35 |
# File 'lib/rom/http/relation.rb', line 33 def project(*names) with(schema: schema.project(*names.flatten)) end |
#rename(mapping) ⇒ Object
41 42 43 |
# File 'lib/rom/http/relation.rb', line 41 def rename(mapping) with(schema: schema.rename(mapping)) end |
#update(*tuples) ⇒ Object
56 57 58 |
# File 'lib/rom/http/relation.rb', line 56 def update(*tuples) dataset.update(*tuples.map { |t| input_schema[t] }) end |