Skip to content

Commit 0c290b5

Browse files
authored
Merge pull request #87 from ATIX-AG/use_name
Use name if to_s is called
2 parents 2401f73 + 78c7224 commit 0c290b5

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

.rubocop.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
inherit_from:
22
- .rubocop_todo.yml
3-
require:
3+
require:
44
- rubocop-minitest
55
- rubocop-rake
66
- rubocop-rspec
77

8+
Migration/DepartmentName:
9+
Enabled: false
10+
811
AllCops:
9-
TargetRubyVersion: 2.5
12+
TargetRubyVersion: 2.5
1013
NewCops: disable
1114
Exclude:
1215
- 'examples/**/*'

lib/fog/proxmox/compute/models/server.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ module Fog
2626
module Proxmox
2727
class Compute
2828
# Server model
29+
# rubocop:disable ClassLength
2930
class Server < Fog::Compute::Server
3031
identity :vmid
3132
attribute :type
@@ -72,6 +73,10 @@ def initialize(new_attributes = {})
7273
super(new_attributes)
7374
end
7475

76+
def to_s
77+
name
78+
end
79+
7580
def container?
7681
type == 'lxc'
7782
end
@@ -260,6 +265,7 @@ def node
260265
Fog::Proxmox::Compute::Node.new(service: service, node: node_id)
261266
end
262267
end
268+
# rubocop:enable ClassLength
263269
end
264270
end
265271
end

0 commit comments

Comments
 (0)