Class: Conglomerate::BuilderCall

Inherits:
Object
  • Object
show all
Defined in:
lib/conglomerate/builder_call.rb

Defined Under Namespace

Classes: BuilderCallInstance

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ BuilderCall

Returns a new instance of BuilderCall.



5
6
7
8
9
10
11
12
13
14
15
# File 'lib/conglomerate/builder_call.rb', line 5

def initialize(options = {})
  self.name = options.fetch(:name, nil)
  self.opts = options.fetch(:opts, {})
  self.block = options.fetch(:block)
  self.builder = options.fetch(:builder)
  self.array = options.fetch(:array)
  self.iterates = options.fetch(:iterates)

rescue KeyError => e
  raise ArgumentError, e.message.gsub("key not found", "missing argument")
end

Instance Attribute Details

#arrayObject

Returns the value of attribute array.



3
4
5
# File 'lib/conglomerate/builder_call.rb', line 3

def array
  @array
end

#blockObject

Returns the value of attribute block.



3
4
5
# File 'lib/conglomerate/builder_call.rb', line 3

def block
  @block
end

#builderObject

Returns the value of attribute builder.



3
4
5
# File 'lib/conglomerate/builder_call.rb', line 3

def builder
  @builder
end

#iteratesObject

Returns the value of attribute iterates.



3
4
5
# File 'lib/conglomerate/builder_call.rb', line 3

def iterates
  @iterates
end

#nameObject

Returns the value of attribute name.



3
4
5
# File 'lib/conglomerate/builder_call.rb', line 3

def name
  @name
end

#optsObject

Returns the value of attribute opts.



3
4
5
# File 'lib/conglomerate/builder_call.rb', line 3

def opts
  @opts
end

Instance Method Details

#run(context, objects, attrs, attr_name) ⇒ Object



17
18
19
# File 'lib/conglomerate/builder_call.rb', line 17

def run(context, objects, attrs, attr_name)
  BuilderCallInstance.new(self, context, objects, attrs, attr_name).run
end