Class: Object

Inherits:
BasicObject
Defined in:
lib/reactive_record/active_record/reactive_record/dummy_value.rb,
lib/object/tap.rb

Overview

add mehods to Object to determine if this is a dummy object or not

Instance Method Summary collapse

Instance Method Details

#loaded?Boolean

Returns:

  • (Boolean)


3
4
5
# File 'lib/reactive_record/active_record/reactive_record/dummy_value.rb', line 3

def loaded?
  !loading?
end

#loading?Boolean

Returns:

  • (Boolean)


7
8
9
# File 'lib/reactive_record/active_record/reactive_record/dummy_value.rb', line 7

def loading?
  false
end

#present?Boolean

Returns:

  • (Boolean)


11
12
13
# File 'lib/reactive_record/active_record/reactive_record/dummy_value.rb', line 11

def present?
  !!self
end

#tap {|val| ... } ⇒ Object

Yields:

  • (val)


2
3
4
5
6
# File 'lib/object/tap.rb', line 2

def tap
  val = `self.$$is_boolean` ? self==true : self
  yield val
  val
end