diff --git a/lib/kangaru/command.rb b/lib/kangaru/command.rb index 824adc2..cc83a1b 100644 --- a/lib/kangaru/command.rb +++ b/lib/kangaru/command.rb @@ -8,7 +8,7 @@ def initialize(controller:, action:, arguments:) @arguments = arguments end - def self.from_argv(tokens) + def self.parse(tokens) controller = InputParsers::ControllerParser.parse(tokens) action = InputParsers::ActionParser.parse(tokens) arguments = InputParsers::ArgumentParser.parse(tokens) diff --git a/sig/kangaru/command.rbs b/sig/kangaru/command.rbs index 98ebd24..f54b02f 100644 --- a/sig/kangaru/command.rbs +++ b/sig/kangaru/command.rbs @@ -10,6 +10,6 @@ module Kangaru arguments: Hash[Symbol, untyped] ) -> void - def self.from_argv: (Array[String]) -> Command + def self.parse: (Array[String]) -> Command end end diff --git a/spec/kangaru/command_spec.rb b/spec/kangaru/command_spec.rb index c0b63ac..682af7d 100644 --- a/spec/kangaru/command_spec.rb +++ b/spec/kangaru/command_spec.rb @@ -13,8 +13,8 @@ end end - describe ".from_argv" do - subject(:command) { described_class.from_argv(tokens) } + describe ".parse" do + subject(:command) { described_class.parse(tokens) } let(:tokens) { %w[foo bar baz] }