Class: SDM::Cassandra

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, tags: nil, hostname: nil, username: nil, password: nil, port_override: nil, port: nil, tls_required: nil) ⇒ Cassandra

Returns a new instance of Cassandra.



784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
# File 'lib/models/porcelain.rb', line 784

def initialize(
  id: nil,
  name: nil,
  healthy: nil,
  tags: nil,
  hostname: nil,
  username: nil,
  password: nil,
  port_override: nil,
  port: nil,
  tls_required: nil
)
  if id != nil
    @id = id
  end
  if name != nil
    @name = name
  end
  if healthy != nil
    @healthy = healthy
  end
  if tags != nil
    @tags = tags
  end
  if hostname != nil
    @hostname = hostname
  end
  if username != nil
    @username = username
  end
  if password != nil
    @password = password
  end
  if port_override != nil
    @port_override = port_override
  end
  if port != nil
    @port = port
  end
  if tls_required != nil
    @tls_required = tls_required
  end
end

Instance Attribute Details

#healthyObject

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



768
769
770
# File 'lib/models/porcelain.rb', line 768

def healthy
  @healthy
end

#hostnameObject

Returns the value of attribute hostname.



772
773
774
# File 'lib/models/porcelain.rb', line 772

def hostname
  @hostname
end

#idObject

Unique identifier of the Resource.



764
765
766
# File 'lib/models/porcelain.rb', line 764

def id
  @id
end

#nameObject

Unique human-readable name of the Resource.



766
767
768
# File 'lib/models/porcelain.rb', line 766

def name
  @name
end

#passwordObject

Returns the value of attribute password.



776
777
778
# File 'lib/models/porcelain.rb', line 776

def password
  @password
end

#portObject

Returns the value of attribute port.



780
781
782
# File 'lib/models/porcelain.rb', line 780

def port
  @port
end

#port_overrideObject

Returns the value of attribute port_override.



778
779
780
# File 'lib/models/porcelain.rb', line 778

def port_override
  @port_override
end

#tagsObject

Tags is a map of key, value pairs.



770
771
772
# File 'lib/models/porcelain.rb', line 770

def tags
  @tags
end

#tls_requiredObject

Returns the value of attribute tls_required.



782
783
784
# File 'lib/models/porcelain.rb', line 782

def tls_required
  @tls_required
end

#usernameObject

Returns the value of attribute username.



774
775
776
# File 'lib/models/porcelain.rb', line 774

def username
  @username
end

Instance Method Details

#to_json(options = {}) ⇒ Object



828
829
830
831
832
833
834
# File 'lib/models/porcelain.rb', line 828

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