Class: Trello::AssociationFetcher::HasMany

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

Defined Under Namespace

Classes: Fetch, Params

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(model, name, options) ⇒ HasMany

Returns a new instance of HasMany.



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

def initialize(model, name, options)
  @model = model
  @name = name
  @options = options
end

Instance Attribute Details

#modelObject (readonly)

Returns the value of attribute model.



7
8
9
# File 'lib/trello/association_fetcher/has_many.rb', line 7

def model
  @model
end

#nameObject (readonly)

Returns the value of attribute name.



7
8
9
# File 'lib/trello/association_fetcher/has_many.rb', line 7

def name
  @name
end

#optionsObject (readonly)

Returns the value of attribute options.



7
8
9
# File 'lib/trello/association_fetcher/has_many.rb', line 7

def options
  @options
end

Instance Method Details

#fetch(filter_params) ⇒ Object



15
16
17
18
19
20
21
22
23
# File 'lib/trello/association_fetcher/has_many.rb', line 15

def fetch(filter_params)
  params = Params.new(
    association_owner: model,
    association_name: name,
    association_options: options,
    filter: filter_params 
  )
  Fetch.execute(params)
end