Sha256: 86997e86bfcb4ad1642cd839e93c517656347b3a910f234da099f51ade1bde7d
Contents?: true
Size: 708 Bytes
Versions: 22
Compression:
Stored size: 708 Bytes
Contents
module RestCore; end class RestCore::Smash attr_accessor :data def initialize data self.data = data end def [] *keys keys.inject(data) do |r, k| if r.respond_to?(:key) && r.key?(k) r[k] elsif r.respond_to?(:[]) r[k] else return nil # stop here end end end def == rhs if rhs.kind_of?(RestCore::Smash) data == rhs.data else data == rhs end end private def respond_to_missing? msg, include_private=false data.respond_to?(msg, include_private) end def method_missing msg, *args, &block if data.respond_to?(msg) data.public_send(msg, *args, &block) else super end end end
Version data entries
22 entries across 22 versions & 1 rubygems