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

Overview

rubocop:todo Style/Documentation

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


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

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