Class: Comatose::ComatoseDrop

Inherits:
Liquid::Drop show all
Defined in:
lib/comatose/comatose_drop.rb

Instance Attribute Summary

Attributes inherited from Liquid::Drop

#context

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Liquid::Drop

#has_key?, #invoke_drop, #to_liquid

Class Method Details

.define(name, &block) ⇒ Object

Define a new ComatoseDrop by name



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

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

Instance Method Details

#before_method(method) ⇒ Object



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

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