Last active
September 17, 2023 04:38
-
-
Save maxim/d0c1da8f1424814ba20763e390b01145 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
option :foo_a | |
option :foo_b, value: {type: Integer} | |
option :bar_x, value: {type: String} | |
option :bar_y | |
option :bar_z, value: {type: Integer} | |
attr_reader :kwargs | |
def self.from_options(options) | |
new \ | |
foo: { | |
a: options[:foo_a], | |
b: options[:foo_b], | |
}, | |
bar: { | |
x: options[:bar_x], | |
y: options[:bar_y], | |
z: options[:bar_z] | |
} | |
end | |
def initialize(kwargs) | |
@kwargs = kwargs | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment