Sha256: bd00393768b56456487fa591677929cf8822f56267b640ab03db717b1666aa1c

Contents?: true

Size: 339 Bytes

Versions: 3

Compression:

Stored size: 339 Bytes

Contents

module Mirrors
  class InstanceVariableMirror < FieldMirror
    def value
      Mirrors.reflect(@object.instance_variable_get(@name))
    end

    def value=(o)
      @object.instance_variable_set(@name, o)
    end

    def public?
      false
    end

    def protected?
      false
    end

    def private?
      true
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
mirrors-0.0.3 lib/mirrors/field_mirror/instance_variable_mirror.rb
mirrors-0.0.2 lib/mirrors/field_mirror/instance_variable_mirror.rb
mirrors-0.0.1 lib/mirrors/field_mirror/instance_variable_mirror.rb