Class: NcsNavigator::Warehouse::TransformError
- Inherits:
-
Object
- Object
- NcsNavigator::Warehouse::TransformError
- Includes:
- DataMapper::Resource
- Defined in:
- lib/ncs_navigator/warehouse/transform_status.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#as_json ⇒ Hash
Provides fpr a JSON serialization that is compatible with SubprocessTransformer.
- #model_class=(clz) ⇒ Object
-
#to_json ⇒ String
Single-line JSON serialization of #as_json.
Class Method Details
.for_exception(exception, context_message = nil) ⇒ Object
68 69 70 71 72 73 74 75 |
# File 'lib/ncs_navigator/warehouse/transform_status.rb', line 68 def self.for_exception(exception, =nil) TransformError.new(:message => [ , "#{exception.class}: #{exception}", StringifyTrace.stringify_trace(exception.backtrace) ].compact.join("\n") ) end |
Instance Method Details
#as_json ⇒ Hash
Provides fpr a JSON serialization that is compatible with SubprocessTransformer.
83 84 85 86 87 88 89 90 91 |
# File 'lib/ncs_navigator/warehouse/transform_status.rb', line 83 def as_json model.properties. reject { |p| [:id, :transform_status_id].include?(p.name) }. inject({}) { |json, prop| value = self.send(prop.name) json[prop.name.to_s] = value if value json } end |
#model_class=(clz) ⇒ Object
99 100 101 102 103 104 105 106 107 |
# File 'lib/ncs_navigator/warehouse/transform_status.rb', line 99 def model_class=(clz) super if clz.nil? self.table_name = nil elsif clz.respond_to?(:mdes_table_name) self.table_name = clz.mdes_table_name end end |
#to_json ⇒ String
Returns single-line JSON serialization of #as_json.
95 96 97 |
# File 'lib/ncs_navigator/warehouse/transform_status.rb', line 95 def to_json as_json.to_json end |