Sha256: 90a80d1e3cbda692b20ad87cd7b368f28c1ebe6a607aa2737b4c73e9f8663197
Contents?: true
Size: 697 Bytes
Versions: 53
Compression:
Stored size: 697 Bytes
Contents
module Dryml class NoParameterError < RuntimeError; end class TagParameters < Hash def initialize(parameters, exclude_names=nil) if exclude_names.blank? update(parameters) else parameters.each_pair { |k, v| self[k] = v unless k.in?(exclude_names) } end end def method_missing(name, default_content="") if name.to_s =~ /\?$/ has_key?(name.to_s[0..-2].to_sym) else self[name]._?.call(default_content) || "" end end undef_method :default # Question: does this do anything? -Tom def [](param_name) fetch(param_name, nil) end end end
Version data entries
53 entries across 53 versions & 1 rubygems