Module: RPCMapper::QueryMethods
- Included in:
- Relation
- Defined in:
- lib/rpc_mapper/relation/query_methods.rb
Instance Attribute Summary collapse
-
#from_value ⇒ Object
TRP: Define each of the variables the query options will be stored in.
-
#group_values ⇒ Object
TRP: Define each of the variables the query options will be stored in.
-
#having_values ⇒ Object
TRP: Define each of the variables the query options will be stored in.
-
#joins_values ⇒ Object
TRP: Define each of the variables the query options will be stored in.
-
#limit_value ⇒ Object
TRP: Define each of the variables the query options will be stored in.
-
#offset_value ⇒ Object
TRP: Define each of the variables the query options will be stored in.
-
#order_values ⇒ Object
TRP: Define each of the variables the query options will be stored in.
-
#raw_sql_value ⇒ Object
TRP: Define each of the variables the query options will be stored in.
-
#select_values ⇒ Object
TRP: Define each of the variables the query options will be stored in.
-
#where_values ⇒ Object
TRP: Define each of the variables the query options will be stored in.
Instance Method Summary collapse
- #from(table) ⇒ Object
- #group(*args) ⇒ Object
- #having(*args) ⇒ Object
- #joins(*args) ⇒ Object
- #limit(value = true) ⇒ Object
- #offset(value = true) ⇒ Object
- #order(*args) ⇒ Object
- #select(*args) ⇒ Object
- #sql(raw_sql) ⇒ Object
- #where(*args) ⇒ Object
Instance Attribute Details
#from_value ⇒ Object
TRP: Define each of the variables the query options will be stored in.
3 4 5 |
# File 'lib/rpc_mapper/relation/query_methods.rb', line 3 def from_value @from_value end |
#group_values ⇒ Object
TRP: Define each of the variables the query options will be stored in.
3 4 5 |
# File 'lib/rpc_mapper/relation/query_methods.rb', line 3 def group_values @group_values end |
#having_values ⇒ Object
TRP: Define each of the variables the query options will be stored in.
3 4 5 |
# File 'lib/rpc_mapper/relation/query_methods.rb', line 3 def having_values @having_values end |
#joins_values ⇒ Object
TRP: Define each of the variables the query options will be stored in.
3 4 5 |
# File 'lib/rpc_mapper/relation/query_methods.rb', line 3 def joins_values @joins_values end |
#limit_value ⇒ Object
TRP: Define each of the variables the query options will be stored in.
3 4 5 |
# File 'lib/rpc_mapper/relation/query_methods.rb', line 3 def limit_value @limit_value end |
#offset_value ⇒ Object
TRP: Define each of the variables the query options will be stored in.
3 4 5 |
# File 'lib/rpc_mapper/relation/query_methods.rb', line 3 def offset_value @offset_value end |
#order_values ⇒ Object
TRP: Define each of the variables the query options will be stored in.
3 4 5 |
# File 'lib/rpc_mapper/relation/query_methods.rb', line 3 def order_values @order_values end |
#raw_sql_value ⇒ Object
TRP: Define each of the variables the query options will be stored in.
3 4 5 |
# File 'lib/rpc_mapper/relation/query_methods.rb', line 3 def raw_sql_value @raw_sql_value end |
#select_values ⇒ Object
TRP: Define each of the variables the query options will be stored in.
3 4 5 |
# File 'lib/rpc_mapper/relation/query_methods.rb', line 3 def select_values @select_values end |
#where_values ⇒ Object
TRP: Define each of the variables the query options will be stored in.
3 4 5 |
# File 'lib/rpc_mapper/relation/query_methods.rb', line 3 def where_values @where_values end |
Instance Method Details
#from(table) ⇒ Object
42 43 44 |
# File 'lib/rpc_mapper/relation/query_methods.rb', line 42 def from(table) clone.tap { |r| r.from_value = table } end |
#group(*args) ⇒ Object
14 15 16 |
# File 'lib/rpc_mapper/relation/query_methods.rb', line 14 def group(*args) clone.tap { |r| r.group_values += args if args && !args.empty? } end |
#having(*args) ⇒ Object
30 31 32 |
# File 'lib/rpc_mapper/relation/query_methods.rb', line 30 def having(*args) clone.tap { |r| r.having_values += args if args && !args.empty? } end |
#joins(*args) ⇒ Object
22 23 24 |
# File 'lib/rpc_mapper/relation/query_methods.rb', line 22 def joins(*args) clone.tap { |r| r.joins_values += args if args && !args.empty? } end |
#limit(value = true) ⇒ Object
34 35 36 |
# File 'lib/rpc_mapper/relation/query_methods.rb', line 34 def limit(value = true) clone.tap { |r| r.limit_value = value } end |
#offset(value = true) ⇒ Object
38 39 40 |
# File 'lib/rpc_mapper/relation/query_methods.rb', line 38 def offset(value = true) clone.tap { |r| r.offset_value = value } end |
#order(*args) ⇒ Object
18 19 20 |
# File 'lib/rpc_mapper/relation/query_methods.rb', line 18 def order(*args) clone.tap { |r| r.order_values += args if args && !args.empty? } end |
#select(*args) ⇒ Object
6 7 8 9 10 11 12 |
# File 'lib/rpc_mapper/relation/query_methods.rb', line 6 def select(*args) if block_given? to_a.select {|*block_args| yield(*block_args) } else clone.tap { |r| r.select_values += args if args && !args.empty? } end end |
#sql(raw_sql) ⇒ Object
46 47 48 |
# File 'lib/rpc_mapper/relation/query_methods.rb', line 46 def sql(raw_sql) clone.tap { |r| r.raw_sql_value = raw_sql } end |
#where(*args) ⇒ Object
26 27 28 |
# File 'lib/rpc_mapper/relation/query_methods.rb', line 26 def where(*args) clone.tap { |r| r.where_values += args if args && !args.empty? } end |