Class: Object
- Inherits:
- BasicObject
- Defined in:
- lib/keystone/core_ext/blank.rb,
lib/keystone/core_ext/object.rb
Instance Method Summary collapse
-
#blank? ⇒ Boolean
copy from activesupport.
- #class_def(name, &blk) ⇒ Object
- #meta_def(name, &blk) ⇒ Object
- #meta_eval(&blk) ⇒ Object
- #metaclass ⇒ Object
-
#tapp ⇒ Object
1.8.7 エミュレート TODO version 指定 def tap yield(self) self end.
Instance Method Details
#blank? ⇒ Boolean
copy from activesupport
4 5 6 |
# File 'lib/keystone/core_ext/blank.rb', line 4 def blank? respond_to?(:empty?) ? empty? : !self end |
#class_def(name, &blk) ⇒ Object
21 22 23 |
# File 'lib/keystone/core_ext/object.rb', line 21 def class_def(name, &blk) class_eval { define_method name, &blk } end |
#meta_def(name, &blk) ⇒ Object
16 17 18 |
# File 'lib/keystone/core_ext/object.rb', line 16 def (name, &blk) { define_method name, &blk } end |
#meta_eval(&blk) ⇒ Object
11 12 13 |
# File 'lib/keystone/core_ext/object.rb', line 11 def (&blk) .instance_eval(&blk) end |
#metaclass ⇒ Object
4 5 6 7 8 |
# File 'lib/keystone/core_ext/object.rb', line 4 def class << self self end end |
#tapp ⇒ Object
1.8.7 エミュレート TODO version 指定 def tap
yield(self)
self
end
32 33 34 |
# File 'lib/keystone/core_ext/object.rb', line 32 def tapp self.tap{|obj| p obj} end |