Class: GitCompound::Command::Arguments::Type::Type

Inherits:
Object
  • Object
show all
Defined in:
lib/git_compound/command/arguments/type/type.rb

Overview

Abstract argument type

Direct Known Subclasses

Argument::Argument, Parameter::Parameter

Instance Method Summary collapse

Constructor Details

#initialize(key, args) ⇒ Type

Returns a new instance of Type.



8
9
10
11
# File 'lib/git_compound/command/arguments/type/type.rb', line 8

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

Instance Method Details

#parseObject



13
14
15
# File 'lib/git_compound/command/arguments/type/type.rb', line 13

def parse
  valid? ? { @key => value } : {}
end

#usedObject

Returns array of arguments that has been used

Raises:

  • (NotImplementedError)


26
27
28
# File 'lib/git_compound/command/arguments/type/type.rb', line 26

def used
  raise NotImplementedError
end

#valid?Boolean

Return true if arguments array contains this parameter/argument, else - return false

Returns:

  • (Boolean)

Raises:

  • (NotImplementedError)


20
21
22
# File 'lib/git_compound/command/arguments/type/type.rb', line 20

def valid?
  raise NotImplementedError
end