Class: DataType::Object
- Inherits:
-
Base
- Object
- Base
- DataType::Object
show all
- Defined in:
- lib/dsl/data_types/primitives.rb
Overview
Instance Attribute Summary
Attributes inherited from Base
#aliases
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from Base
#==, #column, #column_default_changed?, #dangerous_migration_from?, #initialize, long_text_mock, migrant_data_type?, short_text_mock, #structure_changes_from
Constructor Details
This class inherits a constructor from DataType::Base
Class Method Details
.default_mock ⇒ Object
147
148
149
|
# File 'lib/dsl/data_types/primitives.rb', line 147
def self.default_mock
self.native_class.new
end
|
.native_class ⇒ Object
163
164
165
|
# File 'lib/dsl/data_types/primitives.rb', line 163
def self.native_class
self.to_s.split('::').last.constantize
end
|
Instance Method Details
#column_defaults ⇒ Object
143
144
145
|
# File 'lib/dsl/data_types/primitives.rb', line 143
def column_defaults
{:type => :text }
end
|
151
152
153
|
# File 'lib/dsl/data_types/primitives.rb', line 151
def mock
@value || self.default_mock
end
|
#serialized? ⇒ Boolean
155
156
157
|
# File 'lib/dsl/data_types/primitives.rb', line 155
def serialized?
true
end
|
#serialized_class_name ⇒ Object
159
160
161
|
# File 'lib/dsl/data_types/primitives.rb', line 159
def serialized_class_name
self.class.native_class
end
|