Sha256: fe5a17a8b544f71b701db3b190b5d80997339aa4939826966e8ee70ff7b5f030
Contents?: true
Size: 572 Bytes
Versions: 7
Compression:
Stored size: 572 Bytes
Contents
module Frizz class Environment attr_reader :name def initialize(name, data) @name = name data.each do |attribute, value| ivar_name = "@#{attribute}" instance_variable_set(ivar_name, value) self.class.send :define_method, attribute do instance_variable_get(ivar_name) end end end # This is a creative way to allow for calling frizz.production? or # frizz.staging? from the Middleman view helpers def method_missing(meth, *args, &block) "#{name}?" == meth.to_s end end end
Version data entries
7 entries across 7 versions & 1 rubygems