Class: Trello::AssociationFetcher::HasMany::Params

Inherits:
Object
  • Object
show all
Defined in:
lib/trello/association_fetcher/has_many/params.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(association_owner:, association_name:, association_options:, filter:) ⇒ Params

Returns a new instance of Params.



7
8
9
10
11
12
# File 'lib/trello/association_fetcher/has_many/params.rb', line 7

def initialize(association_owner:, association_name:, association_options:, filter:)
  @association_owner = association_owner
  @association_name = association_name
  @association_options = association_options || {}
  @filter = filter || {}
end

Instance Attribute Details

#association_ownerObject (readonly)

Returns the value of attribute association_owner.



5
6
7
# File 'lib/trello/association_fetcher/has_many/params.rb', line 5

def association_owner
  @association_owner
end

Instance Method Details

#association_classObject



14
15
16
# File 'lib/trello/association_fetcher/has_many/params.rb', line 14

def association_class
  association_options[:via] || infer_class_on(association_name)
end

#fetch_pathObject



18
19
20
# File 'lib/trello/association_fetcher/has_many/params.rb', line 18

def fetch_path
  "/#{parent_restful_resource}/#{parent_restful_resource_id}/#{target_restful_resource}"
end

#filter_paramsObject



22
23
24
# File 'lib/trello/association_fetcher/has_many/params.rb', line 22

def filter_params
  default_filter.merge(filter)
end