Class: Babik::Selection::Path::LocalPath
- Inherits:
-
Object
- Object
- Babik::Selection::Path::LocalPath
- Defined in:
- lib/babik/queryset/lib/selection/path/local_path.rb
Overview
Local path
Direct Known Subclasses
Constant Summary collapse
- OPERATOR_SEPARATOR =
Babik::Selection::Config::OPERATOR_SEPARATOR
Instance Attribute Summary collapse
-
#model ⇒ Object
readonly
Returns the value of attribute model.
-
#operator ⇒ Object
readonly
Returns the value of attribute operator.
-
#secondary_operator ⇒ Object
readonly
Returns the value of attribute secondary_operator.
-
#selected_field ⇒ Object
readonly
Returns the value of attribute selected_field.
-
#selection_path ⇒ Object
readonly
Returns the value of attribute selection_path.
Instance Method Summary collapse
-
#initialize(model, selection_path) ⇒ LocalPath
constructor
Construct a local field path.
-
#left_joins_by_alias ⇒ Hash
A local selection has no related left joins.
-
#target_alias ⇒ String
Return the target table alias.
Constructor Details
#initialize(model, selection_path) ⇒ LocalPath
Construct a local field path
19 20 21 22 23 24 25 |
# File 'lib/babik/queryset/lib/selection/path/local_path.rb', line 19 def initialize(model, selection_path) @model = model @selection_path = selection_path.dup @selected_field, @operator, @secondary_operator = @selection_path.to_s.split(OPERATOR_SEPARATOR) # By default, if no operator is given, 'equal' will be used @operator ||= 'equal' end |
Instance Attribute Details
#model ⇒ Object (readonly)
Returns the value of attribute model.
13 14 15 |
# File 'lib/babik/queryset/lib/selection/path/local_path.rb', line 13 def model @model end |
#operator ⇒ Object (readonly)
Returns the value of attribute operator.
13 14 15 |
# File 'lib/babik/queryset/lib/selection/path/local_path.rb', line 13 def operator @operator end |
#secondary_operator ⇒ Object (readonly)
Returns the value of attribute secondary_operator.
13 14 15 |
# File 'lib/babik/queryset/lib/selection/path/local_path.rb', line 13 def secondary_operator @secondary_operator end |
#selected_field ⇒ Object (readonly)
Returns the value of attribute selected_field.
13 14 15 |
# File 'lib/babik/queryset/lib/selection/path/local_path.rb', line 13 def selected_field @selected_field end |
#selection_path ⇒ Object (readonly)
Returns the value of attribute selection_path.
13 14 15 |
# File 'lib/babik/queryset/lib/selection/path/local_path.rb', line 13 def selection_path @selection_path end |
Instance Method Details
#left_joins_by_alias ⇒ Hash
A local selection has no related left joins
37 38 39 |
# File 'lib/babik/queryset/lib/selection/path/local_path.rb', line 37 def left_joins_by_alias {} end |
#target_alias ⇒ String
Return the target table alias. That is alias of the model table. For the moment, actually, return the name of this model’s table.
31 32 33 |
# File 'lib/babik/queryset/lib/selection/path/local_path.rb', line 31 def target_alias @model.table_name end |