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
-
#tap {|_self| ... } ⇒ Object
1.8.7 エミュレート TODO version 指定.
- #tapp ⇒ Object
Instance Method Details
#blank? ⇒ Boolean
copy from activesupport
3 4 5 |
# File 'lib/keystone/core_ext/blank.rb', line 3 def blank? respond_to?(:empty?) ? empty? : !self end |
#class_def(name, &blk) ⇒ Object
20 21 22 |
# File 'lib/keystone/core_ext/object.rb', line 20 def class_def(name, &blk) class_eval { define_method name, &blk } end |
#meta_def(name, &blk) ⇒ Object
15 16 17 |
# File 'lib/keystone/core_ext/object.rb', line 15 def (name, &blk) { define_method name, &blk } end |
#meta_eval(&blk) ⇒ Object
10 11 12 |
# File 'lib/keystone/core_ext/object.rb', line 10 def (&blk) .instance_eval(&blk) end |
#metaclass ⇒ Object
3 4 5 6 7 |
# File 'lib/keystone/core_ext/object.rb', line 3 def class << self self end end |
#tap {|_self| ... } ⇒ Object
1.8.7 エミュレートTODO version 指定
26 27 28 29 |
# File 'lib/keystone/core_ext/object.rb', line 26 def tap yield(self) self end |
#tapp ⇒ Object
31 32 33 |
# File 'lib/keystone/core_ext/object.rb', line 31 def tapp self.tap{|obj| p obj} end |