Sha256: 175d8cda17402044b3ab22148bf414752478cbff56f20004b3c5912a4488edc3
Contents?: true
Size: 786 Bytes
Versions: 44
Compression:
Stored size: 786 Bytes
Contents
module Radius class DelegatingOpenStruct # :nodoc: attr_accessor :object def initialize(object = nil) @object = object @hash = {} end def dup rv = self.class.new rv.instance_variable_set(:@hash, @hash.dup) rv end def method_missing(method, *args, &block) symbol = (method.to_s =~ /^(.*?)=$/) ? $1.intern : method if (0..1).include?(args.size) if args.size == 1 @hash[symbol] = args.first else if @hash.has_key?(symbol) @hash[symbol] else unless object.nil? @object.send(method, *args, &block) else nil end end end else super end end end end
Version data entries
44 entries across 44 versions & 4 rubygems