Class: TmuxConnector::Host
- Inherits:
-
Object
- Object
- TmuxConnector::Host
- Defined in:
- lib/tmux-connector/host.rb
Instance Attribute Summary collapse
-
#count ⇒ Object
readonly
Returns the value of attribute count.
-
#display_name ⇒ Object
readonly
Returns the value of attribute display_name.
-
#group_id ⇒ Object
readonly
Returns the value of attribute group_id.
-
#sort_value ⇒ Object
Returns the value of attribute sort_value.
-
#ssh_name ⇒ Object
readonly
Returns the value of attribute ssh_name.
Instance Method Summary collapse
-
#initialize(name, config) ⇒ Host
constructor
A new instance of Host.
- #to_s ⇒ Object
Constructor Details
#initialize(name, config) ⇒ Host
Returns a new instance of Host.
12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/tmux-connector/host.rb', line 12 def initialize(name, config) @ssh_name = name groups = name.match(config['regex'])[1..-1] @display_name = create_display_name groups, config @sort_value = config['regex-parts-to']['sort-by'].map { |i| groups[i] }.join '-' @group_id = config['regex-parts-to']['group-by'].map { |i| groups[i] }.join '-' check_range! config['group-ranges'] @count = get_count config end |
Instance Attribute Details
#count ⇒ Object (readonly)
Returns the value of attribute count.
7 8 9 |
# File 'lib/tmux-connector/host.rb', line 7 def count @count end |
#display_name ⇒ Object (readonly)
Returns the value of attribute display_name.
8 9 10 |
# File 'lib/tmux-connector/host.rb', line 8 def display_name @display_name end |
#group_id ⇒ Object (readonly)
Returns the value of attribute group_id.
9 10 11 |
# File 'lib/tmux-connector/host.rb', line 9 def group_id @group_id end |
#sort_value ⇒ Object
Returns the value of attribute sort_value.
5 6 7 |
# File 'lib/tmux-connector/host.rb', line 5 def sort_value @sort_value end |
#ssh_name ⇒ Object (readonly)
Returns the value of attribute ssh_name.
10 11 12 |
# File 'lib/tmux-connector/host.rb', line 10 def ssh_name @ssh_name end |
Instance Method Details
#to_s ⇒ Object
24 25 26 |
# File 'lib/tmux-connector/host.rb', line 24 def to_s() return "<host::#{ display_name }>" end |