Class: Models::Outlet

Inherits:
Base
  • Object
show all
Defined in:
lib/models/outlet.rb

Instance Attribute Summary

Attributes inherited from Base

#client, #data

Instance Method Summary collapse

Methods inherited from Base

#base_record, path, #records, schema, stream, subclasses

Instance Method Details

#extra_recordsObject



22
23
24
25
26
27
28
29
# File 'lib/models/outlet.rb', line 22

def extra_records
  data['attributes'].map do |attribute|
    OutletAttribute.new(
      attribute.merge('outlet_id' => data['id']),
      client
    )
  end
end

#transformObject



16
17
18
19
20
# File 'lib/models/outlet.rb', line 16

def transform
  super.tap do |hash|
    hash.delete 'attributes'
  end
end