Class: LedgerSync::Type::ID
- Inherits:
-
Value
- Object
- ActiveModel::Type::Value
- Value
- LedgerSync::Type::ID
show all
- Includes:
- ValueMixin
- Defined in:
- lib/ledger_sync/type/id.rb
Overview
Instance Method Summary
collapse
Methods included from ValueMixin
#error_message, included, #valid_without_casting?
Instance Method Details
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
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
|
#type ⇒ Object
16
17
18
|
# File 'lib/ledger_sync/type/id.rb', line 16
def type
:id
end
|
#valid_classes ⇒ Object
20
21
22
|
# File 'lib/ledger_sync/type/id.rb', line 20
def valid_classes
[::String, ::Symbol, ::Integer]
end
|