Class: Lalka::InternalBase

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

Direct Known Subclasses

Internal, InternalAsync

Instance Method Summary collapse

Instance Method Details

#callObject



187
188
189
190
191
# File 'lib/lalka.rb', line 187

def call
  yield self
rescue => e
  reject(e)
end

#on_error(&block) ⇒ Object



176
177
178
179
# File 'lib/lalka.rb', line 176

def on_error(&block)
  @on_error = block
  nil
end

#on_success(&block) ⇒ Object



171
172
173
174
# File 'lib/lalka.rb', line 171

def on_success(&block)
  @on_success = block
  nil
end

#tryObject



181
182
183
184
185
# File 'lib/lalka.rb', line 181

def try
  resolve(yield)
rescue => e
  reject(e)
end