Class: LedgerSync::Type::ID

Inherits:
Value
  • Object
show all
Includes:
ValueMixin
Defined in:
lib/ledger_sync/type/id.rb

Overview

:nodoc:

Instance Method Summary collapse

Methods included from ValueMixin

#error_message, included, #valid_without_casting?

Instance Method Details

#cast?Boolean

Returns:



8
9
10
# File 'lib/ledger_sync/type/id.rb', line 8

def cast?
  true
end

#changed_in_place?(raw_old_value, new_value) ⇒ Boolean

Returns:



12
13
14
# File 'lib/ledger_sync/type/id.rb', line 12

def changed_in_place?(raw_old_value, new_value)
  raw_old_value != new_value if new_value.is_a?(::String)
end

#typeObject



16
17
18
# File 'lib/ledger_sync/type/id.rb', line 16

def type
  :id
end

#valid_classesObject



20
21
22
# File 'lib/ledger_sync/type/id.rb', line 20

def valid_classes
  [::String, ::Symbol, ::Integer]
end