Class: Object

Inherits:
BasicObject
Includes:
InMethod, SingletonMethods
Defined in:
lib/vex/base/object/insp.rb,
lib/vex/boot/blank.rb,
lib/vex/base/hash/slop.rb,
lib/vex/base/object/in.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: InMethod, SingletonMethods

Instance Method Summary collapse

Methods included from SingletonMethods

#define_object_method, #singleton_class

Methods included from InMethod

#in?

Instance Method Details

#blank?Boolean

Returns:

  • (Boolean)


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

def blank?
  false
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

#slopObject



79
80
81
82
83
# File 'lib/vex/base/hash/slop.rb', line 79

def slop
  dup.slop!
rescue TypeError # e.g. "Can't dup NilClass"
  self
end

#slop!Object



85
86
87
# File 'lib/vex/base/hash/slop.rb', line 85

def slop!    
  self
end

#sloppy?Boolean

Returns:

  • (Boolean)


89
90
91
# File 'lib/vex/base/hash/slop.rb', line 89

def sloppy?
  false
end