Class: SDM::AKSBasicAuth

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, port: nil, username: nil, password: nil) ⇒ AKSBasicAuth

Returns a new instance of AKSBasicAuth.



1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
# File 'lib/models/porcelain.rb', line 1725

def initialize(
  id: nil,
  name: nil,
  healthy: nil,
  hostname: nil,
  port: nil,
  username: nil,
  password: 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 port != nil
    @port = port
  end
  if username != nil
    @username = username
  end
  if password != nil
    @password = password
  end
end

Instance Attribute Details

#healthyObject

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



1715
1716
1717
# File 'lib/models/porcelain.rb', line 1715

def healthy
  @healthy
end

#hostnameObject

Returns the value of attribute hostname.



1717
1718
1719
# File 'lib/models/porcelain.rb', line 1717

def hostname
  @hostname
end

#idObject

Unique identifier of the Resource.



1711
1712
1713
# File 'lib/models/porcelain.rb', line 1711

def id
  @id
end

#nameObject

Unique human-readable name of the Resource.



1713
1714
1715
# File 'lib/models/porcelain.rb', line 1713

def name
  @name
end

#passwordObject

Returns the value of attribute password.



1723
1724
1725
# File 'lib/models/porcelain.rb', line 1723

def password
  @password
end

#portObject

Returns the value of attribute port.



1719
1720
1721
# File 'lib/models/porcelain.rb', line 1719

def port
  @port
end

#usernameObject

Returns the value of attribute username.



1721
1722
1723
# File 'lib/models/porcelain.rb', line 1721

def username
  @username
end

Instance Method Details

#to_json(options = {}) ⇒ Object



1757
1758
1759
1760
1761
1762
1763
# File 'lib/models/porcelain.rb', line 1757

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