Class OpenTox::Feature
In: lib/opentox-ruby-api-wrapper.rb
Parent: OpenTox

Methods

name   new   value  

Public Class methods

Initialize with :uri => uri, or :name => name, :values => hash_of_property_names_and_values

[Source]

# File lib/opentox-ruby-api-wrapper.rb, line 52
                def initialize(params)
                        if params[:uri]
                                @uri = params[:uri].to_s
                        else
                                @uri = ENV['OPENTOX_FEATURES'] + uri_escape(params[:name]) 
                                params[:values].each do |k,v|
                                        @uri += '/' + k.to_s + '/' + v.to_s
                                end
                        end
                end

Public Instance methods

Get the name of the feature

[Source]

# File lib/opentox-ruby-api-wrapper.rb, line 69
                def name
                        RestClient.get @uri + '/name'
                end

Get the value of a property

[Source]

# File lib/opentox-ruby-api-wrapper.rb, line 64
                def value(property)
                        RestClient.get @uri + '/' + property
                end

[Validate]