Class: SSH::Allow::Rule::Deny

Inherits:
SSH::Allow::Rule show all
Defined in:
lib/ssh/allow/rule.rb

Instance Attribute Summary

Attributes inherited from SSH::Allow::Rule

#arguments, #command, #options

Instance Method Summary collapse

Methods inherited from SSH::Allow::Rule

allow, #args, create, deny, #initialize, #match_arguments?, #match_command?, #match_options?, #opts

Constructor Details

This class inherits a constructor from SSH::Allow::Rule

Instance Method Details

#match?(command) ⇒ Boolean

Returns:

  • (Boolean)


89
90
91
92
93
# File 'lib/ssh/allow/rule.rb', line 89

def match?(command)
  match = [match_command?(command.name), match_options?(command.options),
    match_arguments?(command.arguments)].inject(true) { |mem, var| var && mem }
  return match, !match
end