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, #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
136
137
138
|
# File 'lib/dsl/data_types/primitives.rb', line 136
def self.default_mock
self.native_class.new
end
|
.native_class ⇒ Object
152
153
154
|
# File 'lib/dsl/data_types/primitives.rb', line 152
def self.native_class
self.to_s.split('::').last.constantize
end
|
Instance Method Details
#column_defaults ⇒ Object
132
133
134
|
# File 'lib/dsl/data_types/primitives.rb', line 132
def column_defaults
{:type => :text }
end
|
140
141
142
|
# File 'lib/dsl/data_types/primitives.rb', line 140
def mock
@value || self.default_mock
end
|
#serialized? ⇒ Boolean
144
145
146
|
# File 'lib/dsl/data_types/primitives.rb', line 144
def serialized?
true
end
|
#serialized_class_name ⇒ Object
148
149
150
|
# File 'lib/dsl/data_types/primitives.rb', line 148
def serialized_class_name
self.class.native_class
end
|