Class: Confluence::Attachment
Instance Attribute Summary collapse
Class Method Summary
collapse
Instance Method Summary
collapse
Methods included from Findable
find
Methods inherited from Record
#[], #[]=, client, #client, client=, #initialize, #labels, #labels=, record_attr_accessor, #record_id, #to_hash
Instance Attribute Details
#data ⇒ Object
14
15
16
|
# File 'lib/confluence/attachment.rb', line 14
def data
@data ||= client.getAttachmentData(page_id, filename, "0")
end
|
Class Method Details
.find_criteria(args) ⇒ Object
30
31
32
33
34
|
# File 'lib/confluence/attachment.rb', line 30
def self.find_criteria(args)
if args.key? :page_id and args.key? :filename
self.new(client.getAttachment(args[:page_id], args[:filename], args[:version] || "0"))
end
end
|
Instance Method Details
#remove ⇒ Object
26
27
28
|
# File 'lib/confluence/attachment.rb', line 26
def remove
client.removeAttachment(page_id, filename)
end
|
#store ⇒ Object
18
19
20
21
22
23
24
|
# File 'lib/confluence/attachment.rb', line 18
def store
initialize(client.addAttachment(page_id, self.to_hash, XMLRPC::Base64.new(@data)))
self
end
|