Module: DlocalGo::Responses::ResponseParser

Included in:
Base
Defined in:
lib/dlocal_go/responses/response_parser.rb

Overview

Module that makes it easier for DTOs to define their schema

Defined Under Namespace

Modules: ClassMethods

Class Method Summary collapse

Class Method Details

.included(base) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/dlocal_go/responses/response_parser.rb', line 7

def self.included(base)
  base.class_eval { class_attribute :response_attributes, :response_associations, :array_data_attribute }

  base.extend(ClassMethods)

  base.class_eval "    def initialize(response, options = {})\n      extract_options(options)\n\n      assign_attributes(response)\n      assign_associations(response)\n    end\n  CODE\nend\n", __FILE__, __LINE__ + 1