Sha256: 6caa20a38c2fbc9fcfa619c6b60a22394df09c03302b87081649d0eded51f5c1

Contents?: true

Size: 585 Bytes

Versions: 90

Compression:

Stored size: 585 Bytes

Contents

module Hobo

  class Undefined

    def initialize(*args)
      options = args.extract_options!
      @klass = args.first || Object
    end

    def hobo_undefined?
      true
    end

    def class
      @klass
    end

    def is_a?(klass)
      return klass == @klass || klass > @klass
    end

    def to_s
      "<Hobo::Undefined #{@klass}>"
    end

    def inspect
      to_s
    end

    def new_record?
      true
    end

    def method_missing(name, *args)
      raise UndefinedAccessError.new("call to: Hobo::Undefined##{name}")
    end

    undef_method :==

  end

end


Version data entries

90 entries across 90 versions & 1 rubygems

Version Path
hobo-2.2.6 lib/hobo/undefined.rb
hobo-2.2.5 lib/hobo/undefined.rb
hobo-2.2.4 lib/hobo/undefined.rb
hobo-2.2.3 lib/hobo/undefined.rb
hobo-2.2.2 lib/hobo/undefined.rb
hobo-2.2.1 lib/hobo/undefined.rb
hobo-2.2.0 lib/hobo/undefined.rb
hobo-2.1.2 lib/hobo/undefined.rb
hobo-2.1.1 lib/hobo/undefined.rb
hobo-2.1.0 lib/hobo/undefined.rb
hobo-2.1.0.pre4 lib/hobo/undefined.rb
hobo-2.1.0.pre3 lib/hobo/undefined.rb
hobo-2.1.0.pre2 lib/hobo/undefined.rb
hobo-2.1.0.pre1 lib/hobo/undefined.rb
hobo-2.0.1 lib/hobo/undefined.rb
hobo-2.0.0 lib/hobo/undefined.rb
hobo-2.0.0.pre10 lib/hobo/undefined.rb
hobo-2.0.0.pre9 lib/hobo/undefined.rb
hobo-2.0.0.pre8 lib/hobo/undefined.rb
hobo-1.3.3 lib/hobo/undefined.rb