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



192
193
194
195
196
# File 'lib/lalka.rb', line 192

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

#on_error(&block) ⇒ Object



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

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

#on_success(&block) ⇒ Object



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

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

#tryObject



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

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