Class: Checkoff::Attachments
- Inherits:
-
Object
- Object
- Checkoff::Attachments
- Includes:
- Logging
- Defined in:
- lib/checkoff/attachments.rb
Overview
Manage attachments in Asana
Class Method Summary collapse
Instance Method Summary collapse
- #create_attachment_from_url!(url, resource, attachment_name: nil, verify_mode: OpenSSL::SSL::VERIFY_PEER, just_the_url: false) ⇒ Asana::Resources::Attachment
-
#initialize(config: Checkoff::Internal::ConfigLoader.load(:asana), workspaces: Checkoff::Workspaces.new(config:), clients: Checkoff::Clients.new(config:), client: clients.client) ⇒ Attachments
constructor
A new instance of Attachments.
Methods included from Logging
#debug, #error, #finer, #info, #logger, #warn
Constructor Details
#initialize(config: Checkoff::Internal::ConfigLoader.load(:asana), workspaces: Checkoff::Workspaces.new(config:), clients: Checkoff::Clients.new(config:), client: clients.client) ⇒ Attachments
Returns a new instance of Attachments.
48 49 50 51 52 53 54 |
# File 'lib/checkoff/attachments.rb', line 48 def initialize(config: Checkoff::Internal::ConfigLoader.load(:asana), workspaces: Checkoff::Workspaces.new(config:), clients: Checkoff::Clients.new(config:), client: clients.client) @workspaces = workspaces @client = client end |
Class Method Details
.run ⇒ void
This method returns an undefined value.
189 190 191 192 193 194 195 196 197 198 199 200 201 202 |
# File 'lib/checkoff/attachments.rb', line 189 def run # @sg-ignore # @type [String] gid = ARGV[0] || raise('Please pass task gid as first argument') # @sg-ignore # @type [String] url = ARGV[1] || raise('Please pass attachment URL as second argument') tasks = Checkoff::Tasks.new = Checkoff::Attachments.new task = tasks.task_by_gid(gid) = .(url, task) puts "Results: #{.inspect}" end |
Instance Method Details
#create_attachment_from_url!(url, resource, attachment_name: nil, verify_mode: OpenSSL::SSL::VERIFY_PEER, just_the_url: false) ⇒ Asana::Resources::Attachment
63 64 65 66 67 68 69 70 71 72 73 74 |
# File 'lib/checkoff/attachments.rb', line 63 def (url, resource, attachment_name: nil, verify_mode: OpenSSL::SSL::VERIFY_PEER, just_the_url: false) if just_the_url (url, resource, attachment_name:) else (url, resource, attachment_name:, verify_mode:) end end |