Class: Object

Inherits:
BasicObject
Includes:
SingletonMethods
Defined in:
lib/vex/base/object/in.rb,
lib/vex/boot/blank.rb,
lib/vex/base/object/insp.rb,
lib/vex/base/object/singleton_methods.rb,
lib/vex/base/invalid_argument/invalid_argument.rb

Overview

short inspect method on all objects.

“abcdefghijklmnopabcdefghijklmnopabcdefghijklmnopabcdefghijklmnop”.insp

-> "abcdefghijklmnopabcdefghijk..."

Model.find(1).insp

-> "<Model#1>"

Defined Under Namespace

Modules: SingletonMethods, WithBenchmark

Instance Method Summary collapse

Methods included from SingletonMethods

#define_object_method, #singleton_class

Instance Method Details

#blank?Boolean

Returns:

  • (Boolean)

2
3
4
# File 'lib/vex/boot/blank.rb', line 2

def blank?
  false
end

#in?(collection) ⇒ Boolean

Returns:

  • (Boolean)

10
11
12
# File 'lib/vex/base/object/in.rb', line 10

def in?(collection)
  collection.include?(self)
end

#inspObject


10
11
12
13
14
# File 'lib/vex/base/object/insp.rb', line 10

def insp
  body = "#{insp_body}"
  body = ": #{body}" unless body.empty?
  "#{insp_head}#{body}#{insp_close}"
end

#not_implemented!Object


44
45
46
# File 'lib/vex/base/invalid_argument/invalid_argument.rb', line 44

def not_implemented!
  raise MissingImplementation, "#{self.class}##{caller_method_name}"
end