Class: Hash

Inherits:
Object
  • Object
show all
Defined in:
lib/text_filters.rb,
lib/liquid/extensions.rb

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(meth, *arg) ⇒ Object

Having the method_missing catchall in conjunction with get_binding allows us to use the hash as a Context for ERB



122
123
124
125
126
127
128
# File 'lib/text_filters.rb', line 122

def method_missing(meth, *arg)
  if self.has_key? meth.to_s
    self[meth.to_s]
  else
    super
  end
end

Instance Method Details

#get_bindingObject

Gets the binding object for use with ERB



130
131
132
# File 'lib/text_filters.rb', line 130

def get_binding
  binding
end

#to_liquidObject



14
15
16
# File 'lib/liquid/extensions.rb', line 14

def to_liquid
  self
end