Sha256: 2d9309f121968b95c2213b18ef12a6d94212ba2e2fdf757b3449e897134a6db6

Contents?: true

Size: 587 Bytes

Versions: 5

Compression:

Stored size: 587 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

5 entries across 5 versions & 1 rubygems

Version Path
hobo-0.6.3 hobo_files/plugin/lib/hobo/undefined.rb
hobo-0.6.4 hobo_files/plugin/lib/hobo/undefined.rb
hobo-0.7.0 hobo_files/plugin/lib/hobo/undefined.rb
hobo-0.7.1 hobo_files/plugin/lib/hobo/undefined.rb
hobo-0.7.2 hobo_files/plugin/lib/hobo/undefined.rb