Class: ConvenientService::Utils::Object::WithOneTimeObject

Inherits:
Support::Command show all
Defined in:
lib/convenient_service/utils/object/with_one_time_object.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Support::Command

[], call

Constructor Details

#initialize(&block) ⇒ void

Parameters:



22
23
24
# File 'lib/convenient_service/utils/object/with_one_time_object.rb', line 22

def initialize(&block)
  @block = block
end

Instance Attribute Details

#blockObject (readonly)

Returns the value of attribute block.



16
17
18
# File 'lib/convenient_service/utils/object/with_one_time_object.rb', line 16

def block
  @block
end

Instance Method Details

#callObject

Returns Can be any type.

Returns:

  • (Object)

    Can be any type.



29
30
31
# File 'lib/convenient_service/utils/object/with_one_time_object.rb', line 29

def call
  block.call(::Object.new)
end