Class: Trello::AssociationFetcher::HasOne::Params
- Inherits:
-
Object
- Object
- Trello::AssociationFetcher::HasOne::Params
- Defined in:
- lib/trello/association_fetcher/has_one/params.rb
Instance Attribute Summary collapse
-
#association_owner ⇒ Object
readonly
Returns the value of attribute association_owner.
Instance Method Summary collapse
- #association_class ⇒ Object
- #association_restful_id ⇒ Object
- #association_restful_name ⇒ Object
-
#initialize(association_owner:, association_name:, association_options:) ⇒ Params
constructor
A new instance of Params.
Constructor Details
#initialize(association_owner:, association_name:, association_options:) ⇒ Params
Returns a new instance of Params.
7 8 9 10 11 |
# File 'lib/trello/association_fetcher/has_one/params.rb', line 7 def initialize(association_owner:, association_name:, association_options:) @association_owner = association_owner @association_name = association_name @association_options = || {} end |
Instance Attribute Details
#association_owner ⇒ Object (readonly)
Returns the value of attribute association_owner.
5 6 7 |
# File 'lib/trello/association_fetcher/has_one/params.rb', line 5 def association_owner @association_owner end |
Instance Method Details
#association_class ⇒ Object
13 14 15 |
# File 'lib/trello/association_fetcher/has_one/params.rb', line 13 def association_class [:via] || infer_class_on(association_name) end |
#association_restful_id ⇒ Object
21 22 23 24 |
# File 'lib/trello/association_fetcher/has_one/params.rb', line 21 def association_restful_id id_field = [:using] || :id association_owner.send(id_field) end |
#association_restful_name ⇒ Object
17 18 19 |
# File 'lib/trello/association_fetcher/has_one/params.rb', line 17 def association_restful_name [:path] end |