Class: Core::Endpoint::BasicHandler::Associations::BelongsTo::Handler

Inherits:
Object
  • Object
show all
Includes:
EndpointLookup
Defined in:
app/api/core/endpoint/basic_handler/associations/belongs_to.rb

Defined Under Namespace

Classes: Association

Instance Method Summary collapse

Constructor Details

#initialize(name, options) ⇒ Handler

Returns a new instance of Handler


5
6
7
8
# File 'app/api/core/endpoint/basic_handler/associations/belongs_to.rb', line 5

def initialize(name, options)
  @name, @options = name, options
  @throughs = Array(options[:through])
end

Instance Method Details

#separate(associations, _) ⇒ Object


52
53
54
# File 'app/api/core/endpoint/basic_handler/associations/belongs_to.rb', line 52

def separate(associations, _)
  associations[@options[:json].to_s] = Association.new(method(:endpoint_details))
end