Class: InstanceData
- Inherits:
-
Struct
- Object
- Struct
- InstanceData
- Includes:
- JSONModel
- Defined in:
- backend/app/lib/user_defined_field_migrator.rb
Constant Summary
- UNKNOWN_DIMENSION =
'99999999'
Instance Attribute Summary (collapse)
-
- (Object) box_type
Returns the value of attribute box_type.
-
- (Object) exported_to_voyager
Returns the value of attribute exported_to_voyager.
-
- (Object) restricted
Returns the value of attribute restricted.
-
- (Object) voyager_info
Returns the value of attribute voyager_info.
Class Method Summary (collapse)
Instance Method Summary (collapse)
-
- (Object) container_profile
-
- (Boolean) empty?
-
- (Object) voyager_bib_id
-
- (Object) voyager_holding_id
Methods included from JSONModel
JSONModel, #JSONModel, add_error_handler, all, allow_unmapped_enum_value, backend_url, client_mode?, custom_validations, destroy_model, enum_default_value, enum_values, handle_error, init, load_schema, #models, models, parse_jsonmodel_ref, parse_reference, repository, repository_for, schema_src, set_repository, strict_mode, strict_mode?, with_repository
Instance Attribute Details
- (Object) box_type
Returns the value of attribute box_type
334 335 336 |
# File 'backend/app/lib/user_defined_field_migrator.rb', line 334 def box_type @box_type end |
- (Object) exported_to_voyager
Returns the value of attribute exported_to_voyager
334 335 336 |
# File 'backend/app/lib/user_defined_field_migrator.rb', line 334 def exported_to_voyager @exported_to_voyager end |
- (Object) restricted
Returns the value of attribute restricted
334 335 336 |
# File 'backend/app/lib/user_defined_field_migrator.rb', line 334 def restricted @restricted end |
- (Object) voyager_info
Returns the value of attribute voyager_info
334 335 336 |
# File 'backend/app/lib/user_defined_field_migrator.rb', line 334 def voyager_info @voyager_info end |
Class Method Details
+ (Object) from_row(row)
340 341 342 343 |
# File 'backend/app/lib/user_defined_field_migrator.rb', line 340 def self.from_row(row) new(row[:userDefinedString1], row[:userDefinedString2], row[:userDefinedBoolean1], row[:userDefinedBoolean2]) end |
Instance Method Details
- (Object) container_profile
358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 |
# File 'backend/app/lib/user_defined_field_migrator.rb', line 358 def container_profile if !box_type || box_type.empty? return nil end profile = ContainerProfile[:name => box_type] if !profile profile = ContainerProfile.create_from_json(JSONModel(:container_profile).from_hash('name' => box_type, 'dimension_units' => 'inches', 'extent_dimension' => 'width', 'height' => UNKNOWN_DIMENSION, 'width' => UNKNOWN_DIMENSION, 'depth' => UNKNOWN_DIMENSION)) end profile end |
- (Boolean) empty?
378 379 380 |
# File 'backend/app/lib/user_defined_field_migrator.rb', line 378 def empty? voyager_info.empty? && box_type.empty? && restricted.nil? && exported_to_voyager.nil? end |
- (Object) voyager_bib_id
346 347 348 349 350 |
# File 'backend/app/lib/user_defined_field_migrator.rb', line 346 def voyager_bib_id if voyager_info && !voyager_info.empty? self[:voyager_info].split("_")[0] end end |
- (Object) voyager_holding_id
352 353 354 355 356 |
# File 'backend/app/lib/user_defined_field_migrator.rb', line 352 def voyager_holding_id if voyager_info && !voyager_info.empty? self[:voyager_info].split("_")[1] end end |