Sha256: acad28a07d326ed471503261d00bfdad77113c07409d99384c80298c46ba1ed6
Contents?: true
Size: 394 Bytes
Versions: 6
Compression:
Stored size: 394 Bytes
Contents
# Creates constants of aliases expecting a hash of existing constants mapped to their aliases. class Alias::Creators::ConstantCreator < Alias::Creator map {|config| config.map {|k,v| {:name=>k, :alias=>v}} } valid :alias, :unless=>:constant, :optional=>true valid :name, :if=>:constant generate do |aliases| aliases.map {|e| "::#{e[:alias]} = ::#{e[:name]}"}.join("\n") end end
Version data entries
6 entries across 6 versions & 2 rubygems