Class: Object

Inherits:
BasicObject
Defined in:
lib/gooddata/extensions/object.rb

Overview

Copyright (c) 2010-2017 GoodData Corporation. All rights reserved. This source code is licensed under the BSD-style license found in the LICENSE file in the root directory of this source tree.

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.set_const(name, val) ⇒ Object



9
10
11
12
# File 'lib/gooddata/extensions/object.rb', line 9

def set_const(name, val)
  send(:remove_const, name) if const_defined?(name)
  send(:const_set, name, val)
end

Instance Method Details

#blank?Boolean

Returns:

  • (Boolean)


15
16
17
# File 'lib/gooddata/extensions/object.rb', line 15

def blank?
  respond_to?(:empty?) ? empty? : !self
end

#duplicable?Boolean

Returns:

  • (Boolean)


19
20
21
# File 'lib/gooddata/extensions/object.rb', line 19

def duplicable?
  true
end

#set_const(name, val) ⇒ Object



23
24
25
26
# File 'lib/gooddata/extensions/object.rb', line 23

def set_const(name, val)
  send(:remove_const, name) if const_defined?(name)
  send(:const_set, name, val)
end

#to_bObject



28
29
30
# File 'lib/gooddata/extensions/object.rb', line 28

def to_b
  false
end