Class: Rails::Schema::Transformer::Edge
- Inherits:
-
Object
- Object
- Rails::Schema::Transformer::Edge
- Defined in:
- lib/rails/schema/transformer/edge.rb
Instance Attribute Summary collapse
-
#association_type ⇒ Object
readonly
Returns the value of attribute association_type.
-
#foreign_key ⇒ Object
readonly
Returns the value of attribute foreign_key.
-
#from ⇒ Object
readonly
Returns the value of attribute from.
-
#label ⇒ Object
readonly
Returns the value of attribute label.
-
#polymorphic ⇒ Object
readonly
Returns the value of attribute polymorphic.
-
#reverse_association_type ⇒ Object
Returns the value of attribute reverse_association_type.
-
#reverse_label ⇒ Object
Returns the value of attribute reverse_label.
-
#through ⇒ Object
readonly
Returns the value of attribute through.
-
#to ⇒ Object
readonly
Returns the value of attribute to.
Instance Method Summary collapse
-
#initialize(from:, to:, association_type:, label:, foreign_key: nil, through: nil, polymorphic: false) ⇒ Edge
constructor
A new instance of Edge.
- #to_h ⇒ Object
Constructor Details
#initialize(from:, to:, association_type:, label:, foreign_key: nil, through: nil, polymorphic: false) ⇒ Edge
Returns a new instance of Edge.
10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/rails/schema/transformer/edge.rb', line 10 def initialize(from:, to:, association_type:, label:, foreign_key: nil, through: nil, polymorphic: false) @from = from @to = to @association_type = association_type @label = label @foreign_key = foreign_key @through = through @polymorphic = polymorphic @reverse_label = nil @reverse_association_type = nil end |
Instance Attribute Details
#association_type ⇒ Object (readonly)
Returns the value of attribute association_type.
7 8 9 |
# File 'lib/rails/schema/transformer/edge.rb', line 7 def association_type @association_type end |
#foreign_key ⇒ Object (readonly)
Returns the value of attribute foreign_key.
7 8 9 |
# File 'lib/rails/schema/transformer/edge.rb', line 7 def foreign_key @foreign_key end |
#from ⇒ Object (readonly)
Returns the value of attribute from.
7 8 9 |
# File 'lib/rails/schema/transformer/edge.rb', line 7 def from @from end |
#label ⇒ Object (readonly)
Returns the value of attribute label.
7 8 9 |
# File 'lib/rails/schema/transformer/edge.rb', line 7 def label @label end |
#polymorphic ⇒ Object (readonly)
Returns the value of attribute polymorphic.
7 8 9 |
# File 'lib/rails/schema/transformer/edge.rb', line 7 def polymorphic @polymorphic end |
#reverse_association_type ⇒ Object
Returns the value of attribute reverse_association_type.
8 9 10 |
# File 'lib/rails/schema/transformer/edge.rb', line 8 def reverse_association_type @reverse_association_type end |
#reverse_label ⇒ Object
Returns the value of attribute reverse_label.
8 9 10 |
# File 'lib/rails/schema/transformer/edge.rb', line 8 def reverse_label @reverse_label end |
#through ⇒ Object (readonly)
Returns the value of attribute through.
7 8 9 |
# File 'lib/rails/schema/transformer/edge.rb', line 7 def through @through end |
#to ⇒ Object (readonly)
Returns the value of attribute to.
7 8 9 |
# File 'lib/rails/schema/transformer/edge.rb', line 7 def to @to end |
Instance Method Details
#to_h ⇒ Object
22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/rails/schema/transformer/edge.rb', line 22 def to_h { from: @from, to: @to, association_type: @association_type, label: @label, foreign_key: @foreign_key, through: @through, polymorphic: @polymorphic, reverse_label: @reverse_label, reverse_association_type: @reverse_association_type } end |