Module: SFRest
- Defined in:
- lib/sfrest.rb,
lib/sfrest/cron.rb,
lib/sfrest/info.rb,
lib/sfrest/role.rb,
lib/sfrest/site.rb,
lib/sfrest/task.rb,
lib/sfrest/user.rb,
lib/sfrest/audit.rb,
lib/sfrest/error.rb,
lib/sfrest/group.rb,
lib/sfrest/stage.rb,
lib/sfrest/theme.rb,
lib/sfrest/usage.rb,
lib/sfrest/backup.rb,
lib/sfrest/update.rb,
lib/sfrest/domains.rb,
lib/sfrest/profile.rb,
lib/sfrest/version.rb,
lib/sfrest/codebase.rb,
lib/sfrest/variable.rb,
lib/sfrest/collection.rb,
lib/sfrest/connection.rb,
lib/sfrest/site_guard.rb,
lib/sfrest/pathbuilder.rb,
lib/sfrest/site_ownership.rb,
lib/sfrest/security_settings.rb,
lib/sfrest/task_log_settings.rb,
lib/sfrest/site_update_priority.rb,
lib/sfrest/factory_standard_domain.rb,
lib/sfrest/centralized_role_management.rb
Overview
Base Class for SF rest API sdk
Defined Under Namespace
Classes: AccessDeniedError, ActionForbiddenError, Audit, Backup, BadRequestError, Centralized_role_management, Codebase, Collection, Connection, Cron, Domains, Factory_standard_domain, Group, Info, InvalidApiVersion, InvalidDataError, InvalidResponse, Pathbuilder, Profile, Role, SFError, Security_settings, Site, Site_guard, Site_ownership, Site_update_priority, Stage, Task, TaskNotDoneError, Task_log_settings, Theme, UnprocessableEntity, Update, Usage, User, Variable
Constant Summary collapse
- VERSION =
Just tracks the version of sfrest.
'0.0.49'
Class Attribute Summary collapse
-
.base_url ⇒ Object
Returns the value of attribute base_url.
-
.conn ⇒ Object
Returns the value of attribute conn.
-
.password ⇒ Object
Returns the value of attribute password.
-
.user ⇒ Object
Returns the value of attribute user.
Class Method Summary collapse
-
.find_data_from_results(res, field, datapat, key) ⇒ Object
Extract the return data for ‘key’ based on the result object.
-
.new(url, user, password) ⇒ Object
returns a connection object to the SF Rest api for a specific factory.
Class Attribute Details
.base_url ⇒ Object
Returns the value of attribute base_url.
45 46 47 |
# File 'lib/sfrest.rb', line 45 def base_url @base_url end |
.conn ⇒ Object
Returns the value of attribute conn.
45 46 47 |
# File 'lib/sfrest.rb', line 45 def conn @conn end |
.password ⇒ Object
Returns the value of attribute password.
45 46 47 |
# File 'lib/sfrest.rb', line 45 def password @password end |
.user ⇒ Object
Returns the value of attribute user.
45 46 47 |
# File 'lib/sfrest.rb', line 45 def user @user end |
Class Method Details
.find_data_from_results(res, field, datapat, key) ⇒ Object
Extract the return data for ‘key’ based on the result object
65 66 67 68 69 70 71 72 73 74 75 |
# File 'lib/sfrest.rb', line 65 def self.find_data_from_results(res, field, datapat, key) data = res.reject { |k| k.to_s.match(/time|count/) } raise InvalidDataError('The data you are searching is not a hash') unless data.is_a?(Hash) data.each_value do |datum| datum.each do |dat| return dat[key] if dat[field].to_s =~ /#{datapat}/ end end nil end |
.new(url, user, password) ⇒ Object
returns a connection object to the SF Rest api for a specific factory
51 52 53 54 55 56 |
# File 'lib/sfrest.rb', line 51 def new(url, user, password) @base_url = url @user = user @password = password @conn = SFRest::Connection.new(@base_url, @user, @password) end |