Class: MuchStub::Call

Inherits:
Object
  • Object
show all
Defined in:
lib/much-stub/call.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(*pargs, **kargs, &block) ⇒ Call

Returns a new instance of Call.



7
8
9
10
11
# File 'lib/much-stub/call.rb', line 7

def initialize(*pargs, **kargs, &block)
  @pargs = pargs.empty? ? nil : pargs
  @kargs = kargs.empty? ? nil : kargs
  @block = block
end

Instance Attribute Details

#blockObject (readonly)

Returns the value of attribute block.



5
6
7
# File 'lib/much-stub/call.rb', line 5

def block
  @block
end

#kargsObject (readonly)

Returns the value of attribute kargs.



5
6
7
# File 'lib/much-stub/call.rb', line 5

def kargs
  @kargs
end

#pargsObject (readonly)

Returns the value of attribute pargs.



5
6
7
# File 'lib/much-stub/call.rb', line 5

def pargs
  @pargs
end

Instance Method Details

#argsObject



13
14
15
# File 'lib/much-stub/call.rb', line 13

def args
  @args ||= [*pargs, kargs].compact
end