Class: Trello::AssociationFetcher::HasOne

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

Defined Under Namespace

Classes: Fetch, Params

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(model, name, options) ⇒ HasOne

Returns a new instance of HasOne.



9
10
11
12
13
# File 'lib/trello/association_fetcher/has_one.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_one.rb', line 7

def model
  @model
end

#nameObject (readonly)

Returns the value of attribute name.



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

def name
  @name
end

#optionsObject (readonly)

Returns the value of attribute options.



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

def options
  @options
end

Instance Method Details

#fetchObject



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

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