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