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.



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

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

Instance Method Details

#separate(associations, _) ⇒ Object



55
56
57
# File 'app/api/core/endpoint/basic_handler/associations/belongs_to.rb', line 55

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