Class: PathNode
- Inherits:
-
String
- Object
- String
- PathNode
- Defined in:
- lib/sequel/plugins/join_by_paths.rb
Instance Attribute Summary collapse
-
#model_class ⇒ Object
Returns the value of attribute model_class.
-
#path_str ⇒ Object
Returns the value of attribute path_str.
Instance Method Summary collapse
- #alias_sym ⇒ Object
-
#initialize(str, start_model) ⇒ PathNode
constructor
A new instance of PathNode.
- #set_model_class_by_parent_model(pmclass) ⇒ Object
- #table_name ⇒ Object
Constructor Details
#initialize(str, start_model) ⇒ PathNode
Returns a new instance of PathNode.
12 13 14 15 |
# File 'lib/sequel/plugins/join_by_paths.rb', line 12 def initialize(str, start_model) super(str) @start_model = start_model end |
Instance Attribute Details
#model_class ⇒ Object
Returns the value of attribute model_class.
9 10 11 |
# File 'lib/sequel/plugins/join_by_paths.rb', line 9 def model_class @model_class end |
#path_str ⇒ Object
Returns the value of attribute path_str.
10 11 12 |
# File 'lib/sequel/plugins/join_by_paths.rb', line 10 def path_str @path_str end |
Instance Method Details
#alias_sym ⇒ Object
25 26 27 |
# File 'lib/sequel/plugins/join_by_paths.rb', line 25 def alias_sym @start_model.get_alias_sym(path_str) end |
#set_model_class_by_parent_model(pmclass) ⇒ Object
21 22 23 |
# File 'lib/sequel/plugins/join_by_paths.rb', line 21 def set_model_class_by_parent_model(pmclass) @model_class = pmclass.association_reflection(to_sym)[:class_name].constantize end |
#table_name ⇒ Object
17 18 19 |
# File 'lib/sequel/plugins/join_by_paths.rb', line 17 def table_name @model_class.table_name end |