Sha256: 999eb6d5e950b03dd9542f2c4b0c1b812524596a25fc5083ac665470aff68fdf
Contents?: true
Size: 489 Bytes
Versions: 11
Compression:
Stored size: 489 Bytes
Contents
module Danica::VariablesHolder class AliasBuilder attr_reader :clazz, :origin, :destiny def initialize(origin, destiny, clazz) @origin = origin @destiny = destiny @clazz = clazz end def build clazz.variables_hash.change_keys! { |k| k == origin ? destiny : k } VariablesBuilder.new([ destiny ], clazz).build clazz.send(:alias_method, "#{origin}=", "#{destiny}=") clazz.send(:alias_method, origin, destiny) end end end
Version data entries
11 entries across 11 versions & 1 rubygems