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.



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

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.



3
4
5
# File 'lib/much-stub/call.rb', line 3

def block
  @block
end

#kargsObject (readonly)

Returns the value of attribute kargs.



3
4
5
# File 'lib/much-stub/call.rb', line 3

def kargs
  @kargs
end

#pargsObject (readonly)

Returns the value of attribute pargs.



3
4
5
# File 'lib/much-stub/call.rb', line 3

def pargs
  @pargs
end

Instance Method Details

#argsObject



11
12
13
# File 'lib/much-stub/call.rb', line 11

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