Class: Comatose::Drop

Inherits:
Liquid::Drop
  • Object
show all
Defined in:
lib/comatose/drop.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.define(name, &block) ⇒ Object

Define a new Comatose::Drop by name



16
17
18
19
20
21
22
# File 'lib/comatose/drop.rb', line 16

def define(name, &block)
  d = Comatose::Drop.new
  d.instance_eval(&block)
  Comatose.registered_drops[name] = d
rescue
  Comatose.logger.debug "Drop '#{name}' was not included: #{$!}"
end

Instance Method Details

#before_method(method) ⇒ Object



7
8
9
10
11
12
# File 'lib/comatose/drop.rb', line 7

def before_method(method)
  self.send(method.to_sym)
rescue
  Comatose.logger.debug "Error calling #{method}: #{$!}"
  raise $!
end