Class: RestApi::Info

Inherits:
Base show all
Includes:
Cacheable
Defined in:
app/models/rest_api/info.rb

Overview

An object which can return info about the REST API

Instance Method Summary collapse

Methods inherited from Base

alias_attribute, aliased_attributes, allow_anonymous?, #as, #as=, #assign_attributes, attr_alters, #attributes=, calculated_attributes, #clone, configuration=, connection, custom_id, delete, #dup, #duplicate_errors, element_path, exception_for_code, find, find_one, get, #get, #has_exit_code?, headers, #initialize, #load, #load_remote_errors, on_exit_code, #raise_on_invalid, #reload, remote_errors_for, #remote_results, #save!, #save_with_change_tracking, shared_connection, singleton?, #to_json, translate_api_error, use_patch_on_update?, #valid?

Methods included from ActiveResource::Associations

#belongs_to, #has_many, #has_one

Constructor Details

This class inherits a constructor from RestApi::Base

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class RestApi::Base

Instance Method Details



25
26
27
# File 'app/models/rest_api/info.rb', line 25

def link(name)
  URI.parse(data[name]['href']) if data[name]
end

#required_params(name) ⇒ Object



28
29
30
# File 'app/models/rest_api/info.rb', line 28

def required_params(name)
  data[name]['required_params'] if data[name]
end

#urlObject



22
23
24
# File 'app/models/rest_api/info.rb', line 22

def url
  self.class.site
end