Module: HrrRbSsh::SubclassWithPreferenceListable
- Included in:
- Authentication::Method, Authentication::Method::Publickey::Algorithm, Transport::CompressionAlgorithm, Transport::EncryptionAlgorithm, Transport::KexAlgorithm, Transport::MacAlgorithm, Transport::ServerHostKeyAlgorithm
- Defined in:
- lib/hrr_rb_ssh/subclass_with_preference_listable.rb
Instance Method Summary collapse
Instance Method Details
#[](key) ⇒ Object
10 11 12 |
# File 'lib/hrr_rb_ssh/subclass_with_preference_listable.rb', line 10 def [] key __subclass_list__(__method__).find{ |klass| klass::NAME == key } end |
#inherited(klass) ⇒ Object
6 7 8 |
# File 'lib/hrr_rb_ssh/subclass_with_preference_listable.rb', line 6 def inherited klass @subclass_list.push klass if @subclass_list end |
#list_preferred ⇒ Object
18 19 20 |
# File 'lib/hrr_rb_ssh/subclass_with_preference_listable.rb', line 18 def list_preferred __subclass_list__(__method__).select{ |klass| klass::PREFERENCE > 0 }.sort_by{ |klass| klass::PREFERENCE }.reverse.map{ |klass| klass::NAME } end |
#list_supported ⇒ Object
14 15 16 |
# File 'lib/hrr_rb_ssh/subclass_with_preference_listable.rb', line 14 def list_supported __subclass_list__(__method__).map{ |klass| klass::NAME } end |