Class: Trello::AssociationFetcher::HasOne::Fetch

Inherits:
Object
  • Object
show all
Defined in:
lib/trello/association_fetcher/has_one/fetch.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(params) ⇒ Fetch

Returns a new instance of Fetch.



11
12
13
# File 'lib/trello/association_fetcher/has_one/fetch.rb', line 11

def initialize(params)
  @params = params
end

Class Method Details

.execute(params) ⇒ Object



6
7
8
# File 'lib/trello/association_fetcher/has_one/fetch.rb', line 6

def execute(params)
  new(params).execute
end

Instance Method Details

#executeObject



15
16
17
18
19
20
21
# File 'lib/trello/association_fetcher/has_one/fetch.rb', line 15

def execute
  if association_restful_name
    client.find(association_restful_name, association_restful_id)
  else
    association_class.find(association_restful_id)
  end
end