Class: SDM::Druid

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

Returns a new instance of Druid.



868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
# File 'lib/models/porcelain.rb', line 868

def initialize(
	id:nil \
,
	name:nil \
,
	healthy:nil \
,
	tags:nil \
,
	hostname:nil \
,
	port_override:nil \
,
	username:nil \
,
	password:nil \
,
	port: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 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
end

Instance Attribute Details

#healthyObject

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



855
856
857
# File 'lib/models/porcelain.rb', line 855

def healthy
  @healthy
end

#hostnameObject

Returns the value of attribute hostname.



859
860
861
# File 'lib/models/porcelain.rb', line 859

def hostname
  @hostname
end

#idObject

Unique identifier of the Resource.



851
852
853
# File 'lib/models/porcelain.rb', line 851

def id
  @id
end

#nameObject

Unique human-readable name of the Resource.



853
854
855
# File 'lib/models/porcelain.rb', line 853

def name
  @name
end

#passwordObject

Returns the value of attribute password.



865
866
867
# File 'lib/models/porcelain.rb', line 865

def password
  @password
end

#portObject

Returns the value of attribute port.



867
868
869
# File 'lib/models/porcelain.rb', line 867

def port
  @port
end

#port_overrideObject

Returns the value of attribute port_override.



861
862
863
# File 'lib/models/porcelain.rb', line 861

def port_override
  @port_override
end

#tagsObject

Tags is a map of key, value pairs.



857
858
859
# File 'lib/models/porcelain.rb', line 857

def tags
  @tags
end

#usernameObject

Returns the value of attribute username.



863
864
865
# File 'lib/models/porcelain.rb', line 863

def username
  @username
end

Instance Method Details

#to_json(options = {}) ⇒ Object



915
916
917
918
919
920
921
# File 'lib/models/porcelain.rb', line 915

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