Class: StrokeDB::Callback

Inherits:
Object show all
Defined in:
lib/strokedb/document/callback.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(origin, name, uid = nil, &block) ⇒ Callback

Returns a new instance of Callback.



4
5
6
# File 'lib/strokedb/document/callback.rb', line 4

def initialize(origin, name, uid=nil, &block)
  @origin, @name, @uid, @block = origin, name, uid, block
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



3
4
5
# File 'lib/strokedb/document/callback.rb', line 3

def name
  @name
end

#originObject (readonly)

Returns the value of attribute origin.



3
4
5
# File 'lib/strokedb/document/callback.rb', line 3

def origin
  @origin
end

#uidObject (readonly)

Returns the value of attribute uid.



3
4
5
# File 'lib/strokedb/document/callback.rb', line 3

def uid
  @uid
end

Instance Method Details

#call(*args) ⇒ Object



7
8
9
# File 'lib/strokedb/document/callback.rb', line 7

def call(*args)
  @block.call(*args)
end