Class: Syncify::Hint::BasicHint
- Defined in:
- lib/syncify/hint/basic_hint.rb
Instance Attribute Summary collapse
-
#allowed ⇒ Object
(also: #allowed?)
Returns the value of attribute allowed.
-
#association ⇒ Object
Returns the value of attribute association.
-
#from_class ⇒ Object
Returns the value of attribute from_class.
-
#to_class ⇒ Object
Returns the value of attribute to_class.
Instance Method Summary collapse
- #applicable?(candidate_association) ⇒ Boolean
-
#initialize(from_class: nil, association: nil, to_class: nil, allowed:) ⇒ BasicHint
constructor
A new instance of BasicHint.
Constructor Details
#initialize(from_class: nil, association: nil, to_class: nil, allowed:) ⇒ BasicHint
Returns a new instance of BasicHint.
7 8 9 10 11 12 |
# File 'lib/syncify/hint/basic_hint.rb', line 7 def initialize(from_class: nil, association: nil, to_class: nil, allowed:) @from_class = from_class @association = association @to_class = to_class @allowed = allowed end |
Instance Attribute Details
#allowed ⇒ Object Also known as: allowed?
Returns the value of attribute allowed.
4 5 6 |
# File 'lib/syncify/hint/basic_hint.rb', line 4 def allowed @allowed end |
#association ⇒ Object
Returns the value of attribute association.
4 5 6 |
# File 'lib/syncify/hint/basic_hint.rb', line 4 def association @association end |
#from_class ⇒ Object
Returns the value of attribute from_class.
4 5 6 |
# File 'lib/syncify/hint/basic_hint.rb', line 4 def from_class @from_class end |
#to_class ⇒ Object
Returns the value of attribute to_class.
4 5 6 |
# File 'lib/syncify/hint/basic_hint.rb', line 4 def to_class @to_class end |
Instance Method Details
#applicable?(candidate_association) ⇒ Boolean
14 15 16 17 18 |
# File 'lib/syncify/hint/basic_hint.rb', line 14 def applicable?(candidate_association) evaluate_from(candidate_association) && evaluate_association(candidate_association) && evaluate_to_class(candidate_association) end |