Class: SDM::SSH

Inherits:
Object
  • Object
show all
Defined in:
lib/models/porcelain.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id: nil, name: nil, healthy: nil, hostname: nil, username: nil, port: nil, public_key: nil, port_forwarding: nil) ⇒ SSH

Returns a new instance of SSH.



3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
# File 'lib/models/porcelain.rb', line 3419

def initialize(
  id: nil,
  name: nil,
  healthy: nil,
  hostname: nil,
  username: nil,
  port: nil,
  public_key: nil,
  port_forwarding: nil
)
  if id != nil
    @id = id
  end
  if name != nil
    @name = name
  end
  if healthy != nil
    @healthy = healthy
  end
  if hostname != nil
    @hostname = hostname
  end
  if username != nil
    @username = username
  end
  if port != nil
    @port = port
  end
  if public_key != nil
    @public_key = public_key
  end
  if port_forwarding != nil
    @port_forwarding = port_forwarding
  end
end

Instance Attribute Details

#healthyObject

True if the datasource is reachable and the credentials are valid.



3407
3408
3409
# File 'lib/models/porcelain.rb', line 3407

def healthy
  @healthy
end

#hostnameObject

Returns the value of attribute hostname.



3409
3410
3411
# File 'lib/models/porcelain.rb', line 3409

def hostname
  @hostname
end

#idObject

Unique identifier of the Resource.



3403
3404
3405
# File 'lib/models/porcelain.rb', line 3403

def id
  @id
end

#nameObject

Unique human-readable name of the Resource.



3405
3406
3407
# File 'lib/models/porcelain.rb', line 3405

def name
  @name
end

#portObject

Returns the value of attribute port.



3413
3414
3415
# File 'lib/models/porcelain.rb', line 3413

def port
  @port
end

#port_forwardingObject

Returns the value of attribute port_forwarding.



3417
3418
3419
# File 'lib/models/porcelain.rb', line 3417

def port_forwarding
  @port_forwarding
end

#public_keyObject

Returns the value of attribute public_key.



3415
3416
3417
# File 'lib/models/porcelain.rb', line 3415

def public_key
  @public_key
end

#usernameObject

Returns the value of attribute username.



3411
3412
3413
# File 'lib/models/porcelain.rb', line 3411

def username
  @username
end

Instance Method Details

#to_json(options = {}) ⇒ Object



3455
3456
3457
3458
3459
3460
3461
# File 'lib/models/porcelain.rb', line 3455

def to_json(options = {})
  hash = {}
  self.instance_variables.each do |var|
    hash[var.id2name.delete_prefix("@")] = self.instance_variable_get var
  end
  hash.to_json
end