Module: Useful::RubyExtensions::Object
- Included in:
- Object
- Defined in:
- lib/useful/ruby_extensions/object.rb
Defined Under Namespace
Modules: FromActivesupport
Class Method Summary
collapse
Instance Method Summary
collapse
Class Method Details
.included(receiver) ⇒ Object
126
127
128
|
# File 'lib/useful/ruby_extensions/object.rb', line 126
def self.included(receiver)
receiver.send :include, FromActivesupport
end
|
Instance Method Details
#capture_std_output ⇒ Object
18
19
20
21
22
23
24
25
26
27
28
|
# File 'lib/useful/ruby_extensions/object.rb', line 18
def capture_std_output
out = ::StringIO.new
err = ::StringIO.new
$stdout = out
$stderr = err
yield
return out, err
ensure
$stdout = STDOUT
$stderr = STDERR
end
|
#false? ⇒ Boolean
Also known as:
is_false?
8
9
10
|
# File 'lib/useful/ruby_extensions/object.rb', line 8
def false?
self == false
end
|
#true? ⇒ Boolean
Also known as:
is_true?
13
14
15
|
# File 'lib/useful/ruby_extensions/object.rb', line 13
def true?
self == true
end
|