module Malt::Kernel

Common methods that can be used through-out Malt classes.

Private Instance Methods

ext_to_type(ext) click to toggle source
# File lib/malt/kernel.rb, line 18
def ext_to_type(ext)
  ext = ext.to_s.downcase
  return nil if ext.empty?
  if ext[0,1] == '.'
    ext[1..-1].to_sym
  else
    ext.to_sym
  end
end
make_ostruct(hash) click to toggle source
# File lib/malt/kernel.rb, line 8
def make_ostruct(hash)
  case hash
  when OpenStruct
    hash
  else
    OpenStruct.new(hash)
  end
end