Class: Bookbinder::CommandValidator::Candidate

Inherits:
Struct
  • Object
show all
Includes:
Bookbinder::Commands::Naming
Defined in:
lib/bookbinder/command_validator.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Bookbinder::Commands::Naming

#command_for?, #command_type, #flag?

Instance Attribute Details

#command_nameObject

Returns the value of attribute command_name



31
32
33
# File 'lib/bookbinder/command_validator.rb', line 31

def command_name
  @command_name
end

#commandsObject

Returns the value of attribute commands



31
32
33
# File 'lib/bookbinder/command_validator.rb', line 31

def commands
  @commands
end

Instance Method Details

#deprecated_matchObject



38
39
40
41
42
43
# File 'lib/bookbinder/command_validator.rb', line 38

def deprecated_match
  @deprecated_match ||= commands.find { |command|
    command.respond_to?(:deprecated_command_for?) &&
      command.deprecated_command_for?(command_name)
  }
end

#unrecognized?Boolean



34
35
36
# File 'lib/bookbinder/command_validator.rb', line 34

def unrecognized?
  commands.none? { |command| command.command_for?(command_name) }
end