Module: FragmentHelper

Defined in:
lib/milksteak/liquid_helpers.rb

Instance Method Summary collapse

Instance Method Details

#fragment(name) ⇒ Object



2
3
4
# File 'lib/milksteak/liquid_helpers.rb', line 2

def fragment(name)
  Milksteak::Fragment.render(name)
end

#hash_attribute(hash, name) ⇒ Object



6
7
8
9
10
11
12
13
14
# File 'lib/milksteak/liquid_helpers.rb', line 6

def hash_attribute(hash, name)
  if hash.keys.include?(name)
    return hash[name]
  elsif hash.keys.include?(name.to_sym)
    return hash[name.to_sym]
  else
    nil
  end
end

#inspect(obj) ⇒ Object



16
17
18
# File 'lib/milksteak/liquid_helpers.rb', line 16

def inspect(obj)
  return obj.inspect
end