Class: ROM::SQL::Relation
- Inherits:
-
Relation
- Object
- Relation
- ROM::SQL::Relation
- Extended by:
- ClassMethods
- Includes:
- Associations, Inspection, Reading, Writing
- Defined in:
- lib/rom/sql/relation.rb,
lib/rom/sql/relation/reading.rb,
lib/rom/sql/relation/writing.rb,
lib/rom/sql/relation/inspection.rb,
lib/rom/sql/relation/associations.rb,
lib/rom/sql/relation/class_methods.rb
Overview
Sequel-specific relation extensions
Defined Under Namespace
Modules: Associations, ClassMethods, Inspection, Reading, Writing
Instance Attribute Summary collapse
-
#header ⇒ Header
readonly
private
Return a header for this relation.
-
#table ⇒ Object
readonly
Name of the table used in FROM clause.
Instance Method Summary collapse
-
#columns ⇒ Array<Symbol>
private
Return raw column names.
-
#initialize(dataset, registry = {}) ⇒ Relation
constructor
private
A new instance of Relation.
Methods included from ClassMethods
finalize, inherited, many_to_many, many_to_one, one_to_many
Methods included from Reading
#count, #distinct, #exclude, #first, #group, #group_and_count, #inner_join, #invert, #last, #left_join, #limit, #map, #offset, #order, #prefix, #project, #qualified, #qualified_columns, #rename, #reverse, #select, #select_append, #select_group, #unique?, #where
Methods included from Writing
#delete, #insert, #multi_insert, #update
Methods included from Associations
#association_join, #association_left_join, #graph, #graph_join
Methods included from Inspection
Constructor Details
#initialize(dataset, registry = {}) ⇒ Relation
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of Relation.
32 33 34 35 |
# File 'lib/rom/sql/relation.rb', line 32 def initialize(dataset, registry = {}) super @table = dataset.opts[:from].first end |
Instance Attribute Details
#header ⇒ Header (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Return a header for this relation
24 25 26 |
# File 'lib/rom/sql/relation.rb', line 24 def header @header end |
#table ⇒ Object (readonly)
Name of the table used in FROM clause
29 30 31 |
# File 'lib/rom/sql/relation.rb', line 29 def table @table end |
Instance Method Details
#columns ⇒ Array<Symbol>
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Return raw column names
51 52 53 |
# File 'lib/rom/sql/relation.rb', line 51 def columns dataset.columns end |