Class: PikoTools::Builder

Inherits:
Object
  • Object
show all
Defined in:
lib/piko_tools/builder.rb

Instance Method Summary collapse

Constructor Details

#initialize(base) ⇒ Builder

Returns a new instance of Builder.



3
4
5
# File 'lib/piko_tools/builder.rb', line 3

def initialize(base)
  @base = base
end

Instance Method Details

#build(args = {}) ⇒ Object



13
14
15
16
17
# File 'lib/piko_tools/builder.rb', line 13

def build(args = {})
  set(args)
  @args[:build_args] = args
  @base.new(@args)
end

#set(args = {}) ⇒ Object



7
8
9
10
11
# File 'lib/piko_tools/builder.rb', line 7

def set(args = {})
  @args ||= {}
  @args.merge!(args)
  self
end