Class: Bunto::Compose::MovementArgParser

Inherits:
Object
  • Object
show all
Defined in:
lib/bunto-compose/movement_arg_parser.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(args, options) ⇒ MovementArgParser

Returns a new instance of MovementArgParser.



5
6
7
8
# File 'lib/bunto-compose/movement_arg_parser.rb', line 5

def initialize(args, options)
  @args = args
  @options = options
end

Instance Attribute Details

#argsObject (readonly)

Returns the value of attribute args.



4
5
6
# File 'lib/bunto-compose/movement_arg_parser.rb', line 4

def args
  @args
end

#optionsObject (readonly)

Returns the value of attribute options.



4
5
6
# File 'lib/bunto-compose/movement_arg_parser.rb', line 4

def options
  @options
end

Instance Method Details

#pathObject



14
15
16
# File 'lib/bunto-compose/movement_arg_parser.rb', line 14

def path
  args.join ' '
end

#validate!Object

Raises:

  • (ArgumentError)


10
11
12
# File 'lib/bunto-compose/movement_arg_parser.rb', line 10

def validate!
  raise ArgumentError.new("You must specify a #{resource_type} path.") if args.empty?
end