Module: Files
- Defined in:
- lib/files.com.rb,
lib/files.com/api.rb,
lib/files.com/util.rb,
lib/files.com/errors.rb,
lib/files.com/version.rb,
lib/files.com/response.rb,
lib/files.com/api_client.rb,
lib/files.com/models/dir.rb,
lib/files.com/models/auto.rb,
lib/files.com/models/file.rb,
lib/files.com/models/lock.rb,
lib/files.com/models/plan.rb,
lib/files.com/models/site.rb,
lib/files.com/models/user.rb,
lib/files.com/models/group.rb,
lib/files.com/models/image.rb,
lib/files.com/models/inbox.rb,
lib/files.com/models/style.rb,
lib/files.com/models/action.rb,
lib/files.com/models/bundle.rb,
lib/files.com/models/errors.rb,
lib/files.com/models/folder.rb,
lib/files.com/models/status.rb,
lib/files.com/models/upload.rb,
lib/files.com/models/upsell.rb,
lib/files.com/models/account.rb,
lib/files.com/models/api_key.rb,
lib/files.com/models/history.rb,
lib/files.com/models/invoice.rb,
lib/files.com/models/message.rb,
lib/files.com/models/payment.rb,
lib/files.com/models/preview.rb,
lib/files.com/models/project.rb,
lib/files.com/models/release.rb,
lib/files.com/models/request.rb,
lib/files.com/models/session.rb,
lib/files.com/models/setting.rb,
lib/files.com/models/warning.rb,
lib/files.com/models/behavior.rb,
lib/files.com/models/settings.rb,
lib/files.com/system_profiler.rb,
lib/files.com/models/blog_post.rb,
lib/files.com/models/plan_rate.rb,
lib/files.com/models/automation.rb,
lib/files.com/models/dns_record.rb,
lib/files.com/models/file_utils.rb,
lib/files.com/models/group_user.rb,
lib/files.com/models/ip_address.rb,
lib/files.com/models/permission.rb,
lib/files.com/models/public_key.rb,
lib/files.com/models/bundle_file.rb,
lib/files.com/models/certificate.rb,
lib/files.com/models/file_action.rb,
lib/files.com/models/announcement.rb,
lib/files.com/models/crash_report.rb,
lib/files.com/models/file_comment.rb,
lib/files.com/models/notification.rb,
lib/files.com/models/sso_strategy.rb,
lib/files.com/models/zip_download.rb,
lib/files.com/models/bundle_public.rb,
lib/files.com/models/remote_server.rb,
lib/files.com/models/email_feedback.rb,
lib/files.com/models/oauth_redirect.rb,
lib/files.com/models/paired_api_key.rb,
lib/files.com/models/usage_snapshot.rb,
lib/files.com/models/message_comment.rb,
lib/files.com/models/release_package.rb,
lib/files.com/models/support_request.rb,
lib/files.com/models/user_cipher_use.rb,
lib/files.com/models/email_preference.rb,
lib/files.com/models/file_part_upload.rb,
lib/files.com/models/message_reaction.rb,
lib/files.com/models/u2f_sign_request.rb,
lib/files.com/models/account_line_item.rb,
lib/files.com/models/invoice_line_item.rb,
lib/files.com/models/payment_line_item.rb,
lib/files.com/models/paypal_express_url.rb,
lib/files.com/models/regional_migration.rb,
lib/files.com/models/paypal_express_info.rb,
lib/files.com/models/file_comment_reaction.rb,
lib/files.com/models/message_comment_reaction.rb,
lib/files.com/models/email_preference_notification.rb,
lib/files.com/models/two_factor_authentication_method.rb
Defined Under Namespace
Modules: Util Classes: APIError, Account, AccountLineItem, Action, Announcement, Api, ApiClient, ApiKey, AuthenticationError, Auto, Automation, Behavior, BlogPost, Bundle, BundleFile, BundlePublic, Certificate, ConnectionError, CrashReport, DnsRecord, EmailFeedback, EmailPreference, EmailPreferenceNotification, Error, Errors, File, FileAction, FileComment, FileCommentReaction, FilePartUpload, FileUtils, Folder, Group, GroupUser, History, Image, Inbox, InvalidParameterError, InvalidRequestError, Invoice, InvoiceLineItem, IpAddress, Lock, Message, MessageComment, MessageCommentReaction, MessageReaction, MissingParameterError, NotImplementedError, Notification, OauthRedirect, PairedApiKey, Payment, PaymentLineItem, PaypalExpressInfo, PaypalExpressUrl, Permission, PermissionError, Plan, PlanRate, Preview, Project, PublicKey, RegionalMigration, Release, ReleasePackage, RemoteServer, Request, Response, Session, Setting, Settings, Site, SsoStrategy, Status, Style, SupportRequest, SystemProfiler, TooManyRequestsError, TwoFactorAuthenticationMethod, U2fSignRequest, Upload, Upsell, UsageSnapshot, User, UserCipherUse, ValidationError, Warning, ZipDownload
Constant Summary collapse
- LEVEL_DEBUG =
map to the same values as the standard library’s logger
Logger::DEBUG
- LEVEL_ERROR =
Logger::ERROR
- LEVEL_INFO =
Logger::INFO
- VERSION =
"1.0"
- Dir =
Folder
Class Attribute Summary collapse
-
.api_key ⇒ Object
Returns the value of attribute api_key.
-
.base_url ⇒ Object
Returns the value of attribute base_url.
-
.open_timeout ⇒ Object
Returns the value of attribute open_timeout.
-
.proxy ⇒ Object
Returns the value of attribute proxy.
-
.read_timeout ⇒ Object
Returns the value of attribute read_timeout.
-
.session_id ⇒ Object
Returns the value of attribute session_id.
Class Method Summary collapse
- .app_info ⇒ Object
- .app_info=(info) ⇒ Object
-
.log_level ⇒ Object
When set prompts the library to log some extra information to $stdout and $stderr about what it’s doing.
- .log_level=(val) ⇒ Object
-
.logger ⇒ Object
Sets a logger to which logging output will be sent.
- .logger=(val) ⇒ Object
- .max_network_retries ⇒ Object
- .max_network_retries=(val) ⇒ Object
- .session=(session) ⇒ Object
-
.set_app_info(name, partner_id: nil, url: nil, version: nil) ⇒ Object
Sets some basic information about the running application that’s sent along with API requests.
Class Attribute Details
.api_key ⇒ Object
Returns the value of attribute api_key.
103 104 105 |
# File 'lib/files.com.rb', line 103 def api_key @api_key end |
.base_url ⇒ Object
Returns the value of attribute base_url.
103 104 105 |
# File 'lib/files.com.rb', line 103 def base_url @base_url end |
.open_timeout ⇒ Object
Returns the value of attribute open_timeout.
103 104 105 |
# File 'lib/files.com.rb', line 103 def open_timeout @open_timeout end |
.proxy ⇒ Object
Returns the value of attribute proxy.
103 104 105 |
# File 'lib/files.com.rb', line 103 def proxy @proxy end |
.read_timeout ⇒ Object
Returns the value of attribute read_timeout.
103 104 105 |
# File 'lib/files.com.rb', line 103 def read_timeout @read_timeout end |
.session_id ⇒ Object
Returns the value of attribute session_id.
103 104 105 |
# File 'lib/files.com.rb', line 103 def session_id @session_id end |
Class Method Details
.app_info ⇒ Object
178 179 180 |
# File 'lib/files.com.rb', line 178 def self.app_info @app_info end |
.app_info=(info) ⇒ Object
182 183 184 |
# File 'lib/files.com.rb', line 182 def self.app_info=(info) @app_info = info end |
.log_level ⇒ Object
When set prompts the library to log some extra information to $stdout and $stderr about what it’s doing. For example, it’ll produce information about requests, responses, and errors that are received. Valid log levels are ‘debug` and `info`, with `debug` being a little more verbose in places.
Use of this configuration is only useful when ‘.logger` is not set. When it is, the decision what levels to print is entirely deferred to the logger.
118 119 120 |
# File 'lib/files.com.rb', line 118 def self.log_level @log_level end |
.log_level=(val) ⇒ Object
122 123 124 125 126 127 128 129 130 131 132 133 134 135 |
# File 'lib/files.com.rb', line 122 def self.log_level=(val) # Backwards compatibility for values that we briefly allowed if val == "debug" val = LEVEL_DEBUG elsif val == "info" val = LEVEL_INFO end if !val.nil? && ![ LEVEL_DEBUG, LEVEL_ERROR, LEVEL_INFO ].include?(val) raise ArgumentError, "log_level should only be set to `nil`, `debug` or `info`" end @log_level = val end |
.logger ⇒ Object
Sets a logger to which logging output will be sent. The logger should support the same interface as the ‘Logger` class that’s part of Ruby’s standard library (hint, anything in ‘Rails.logger` will likely be suitable).
If ‘.logger` is set, the value of `.log_level` is ignored. The decision on what levels to print is entirely deferred to the logger.
144 145 146 |
# File 'lib/files.com.rb', line 144 def self.logger @logger end |
.logger=(val) ⇒ Object
148 149 150 |
# File 'lib/files.com.rb', line 148 def self.logger=(val) @logger = val end |
.max_network_retries ⇒ Object
152 153 154 |
# File 'lib/files.com.rb', line 152 def self.max_network_retries @max_network_retries end |
.max_network_retries=(val) ⇒ Object
156 157 158 |
# File 'lib/files.com.rb', line 156 def self.max_network_retries=(val) @max_network_retries = val.to_i end |
.session=(session) ⇒ Object
160 161 162 163 |
# File 'lib/files.com.rb', line 160 def self.session=(session) session.save unless session.id self.session_id = session.id end |
.set_app_info(name, partner_id: nil, url: nil, version: nil) ⇒ Object
Sets some basic information about the running application that’s sent along with API requests.
Takes a name and optional partner program ID, plugin URL, and version.
169 170 171 172 173 174 175 176 |
# File 'lib/files.com.rb', line 169 def self.set_app_info(name, partner_id: nil, url: nil, version: nil) @app_info = { name: name, partner_id: partner_id, url: url, version: version, } end |