class Autobots::Assembler

Attributes

identifiers[R]
objects[R]
options[R]

Public Class Methods

new(identifiers, options = {}) click to toggle source
# File lib/autobots/assembler.rb, line 6
def initialize(identifiers, options = {})
  @identifiers, @options = identifiers, options
  @objects = assemble(identifiers)
end

Public Instance Methods

data() click to toggle source
# File lib/autobots/assembler.rb, line 11
def data
  roll_out(objects)
end

Private Instance Methods

assemble(identifiers) click to toggle source

builds our skeleton resources

# File lib/autobots/assembler.rb, line 18
def assemble(identifiers)
  identifiers
end
roll_out(objects) click to toggle source

serialize everything

# File lib/autobots/assembler.rb, line 28
def roll_out(objects)
  transform(objects).map{|obj| serializer.new(obj).serializable_hash }
end
transform(resources) click to toggle source

fetch any additional objects and modify our resources

# File lib/autobots/assembler.rb, line 23
def transform(resources)
  resources
end