Module: Morpheus::Mixins::Introspection

Included in:
Base
Defined in:
lib/morpheus/mixins/introspection.rb

Instance Method Summary collapse

Instance Method Details

#destroyed?Boolean

Returns:

  • (Boolean)


13
14
15
# File 'lib/morpheus/mixins/introspection.rb', line 13

def destroyed?
  false
end

#new_record?Boolean

Returns:

  • (Boolean)


9
10
11
# File 'lib/morpheus/mixins/introspection.rb', line 9

def new_record?
  !persisted?
end

#persisted?Boolean

Returns:

  • (Boolean)


5
6
7
# File 'lib/morpheus/mixins/introspection.rb', line 5

def persisted?
  !id.nil?
end

#respond_to?(method, include_private = false) ⇒ Boolean

Returns:

  • (Boolean)


17
18
19
# File 'lib/morpheus/mixins/introspection.rb', line 17

def respond_to?(method, include_private = false)
  attributes.include?(method) ? true : super
end