Class: SDM::MongoLegacyHost

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, auth_database: nil, port_override: nil, username: nil, password: nil, port: nil, replica_set: nil, tls_required: nil) ⇒ MongoLegacyHost

Returns a new instance of MongoLegacyHost.



1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
# File 'lib/models/porcelain.rb', line 1886

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

Instance Attribute Details

#auth_databaseObject

Returns the value of attribute auth_database.



1872
1873
1874
# File 'lib/models/porcelain.rb', line 1872

def auth_database
  @auth_database
end

#healthyObject

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



1868
1869
1870
# File 'lib/models/porcelain.rb', line 1868

def healthy
  @healthy
end

#hostnameObject

Returns the value of attribute hostname.



1870
1871
1872
# File 'lib/models/porcelain.rb', line 1870

def hostname
  @hostname
end

#idObject

Unique identifier of the Resource.



1864
1865
1866
# File 'lib/models/porcelain.rb', line 1864

def id
  @id
end

#nameObject

Unique human-readable name of the Resource.



1866
1867
1868
# File 'lib/models/porcelain.rb', line 1866

def name
  @name
end

#passwordObject

Returns the value of attribute password.



1878
1879
1880
# File 'lib/models/porcelain.rb', line 1878

def password
  @password
end

#portObject

Returns the value of attribute port.



1880
1881
1882
# File 'lib/models/porcelain.rb', line 1880

def port
  @port
end

#port_overrideObject

Returns the value of attribute port_override.



1874
1875
1876
# File 'lib/models/porcelain.rb', line 1874

def port_override
  @port_override
end

#replica_setObject

Returns the value of attribute replica_set.



1882
1883
1884
# File 'lib/models/porcelain.rb', line 1882

def replica_set
  @replica_set
end

#tls_requiredObject

Returns the value of attribute tls_required.



1884
1885
1886
# File 'lib/models/porcelain.rb', line 1884

def tls_required
  @tls_required
end

#usernameObject

Returns the value of attribute username.



1876
1877
1878
# File 'lib/models/porcelain.rb', line 1876

def username
  @username
end

Instance Method Details

#to_json(options = {}) ⇒ Object



1934
1935
1936
1937
1938
1939
1940
# File 'lib/models/porcelain.rb', line 1934

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