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



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
827
828
829
830
831
832
833
834
835
836
837
838
839
# File 'lib/models/porcelain.rb', line 788

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.



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

def healthy
  @healthy
end

#hostnameObject

Returns the value of attribute hostname.



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

def hostname
  @hostname
end

#idObject

Unique identifier of the Resource.



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

def id
  @id
end

#nameObject

Unique human-readable name of the Resource.



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

def name
  @name
end

#passwordObject

Returns the value of attribute password.



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

def password
  @password
end

#portObject

Returns the value of attribute port.



785
786
787
# File 'lib/models/porcelain.rb', line 785

def port
  @port
end

#port_overrideObject

Returns the value of attribute port_override.



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

def port_override
  @port_override
end

#tagsObject

Tags is a map of key, value pairs.



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

def tags
  @tags
end

#tls_requiredObject

Returns the value of attribute tls_required.



787
788
789
# File 'lib/models/porcelain.rb', line 787

def tls_required
  @tls_required
end

#usernameObject

Returns the value of attribute username.



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

def username
  @username
end

Instance Method Details

#to_json(options = {}) ⇒ Object



840
841
842
843
844
845
846
# File 'lib/models/porcelain.rb', line 840

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