Class: OpenTox::LazarPrediction

Inherits:
OpenTox
  • Object
show all
Defined in:
lib/opentox-ruby-api-wrapper.rb

Instance Attribute Summary

Attributes inherited from OpenTox

#uri

Instance Method Summary collapse

Methods inherited from OpenTox

#destroy, #finished?, #name, #uri_escape

Constructor Details

#initialize(params) ⇒ LazarPrediction

Returns a new instance of LazarPrediction.



172
173
174
175
176
# File 'lib/opentox-ruby-api-wrapper.rb', line 172

def initialize(params)
	if params[:uri]
		@uri = params[:uri]
	end
end

Instance Method Details

#classificationObject



178
179
180
# File 'lib/opentox-ruby-api-wrapper.rb', line 178

def classification
	YAML.load(RestClient.get @uri)[:classification]
end

#confidenceObject



182
183
184
# File 'lib/opentox-ruby-api-wrapper.rb', line 182

def confidence
	YAML.load(RestClient.get @uri)[:confidence]
end

#featuresObject



190
191
192
# File 'lib/opentox-ruby-api-wrapper.rb', line 190

def features
	RestClient.get @uri + '/features' 
end

#neighborsObject



186
187
188
# File 'lib/opentox-ruby-api-wrapper.rb', line 186

def neighbors
	RestClient.get @uri + '/neighbors' 
end