Class: Dsu::Services::Project::HydratorService
- Inherits:
-
Object
- Object
- Dsu::Services::Project::HydratorService
- Defined in:
- lib/dsu/services/project/hydrator_service.rb
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(project_hash:, options: {}) ⇒ HydratorService
constructor
A new instance of HydratorService.
Constructor Details
#initialize(project_hash:, options: {}) ⇒ HydratorService
Returns a new instance of HydratorService.
9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/dsu/services/project/hydrator_service.rb', line 9 def initialize(project_hash:, options: {}) raise ArgumentError, 'project_hash is nil' if project_hash.nil? unless project_hash.is_a?(Hash) raise ArgumentError, "project_hash is the wrong object type: \"#{project_hash}\"" end raise ArgumentError, 'options is nil' if .nil? raise ArgumentError, "options is the wrong object type:\"#{options}\"" unless .is_a?(Hash) @project_hash = project_hash = || {} end |
Instance Method Details
#call ⇒ Object
23 24 25 |
# File 'lib/dsu/services/project/hydrator_service.rb', line 23 def call Models::Project.new(**hydrate) end |