class Ocman::Share
Public Class Methods
new(path)
click to toggle source
# File lib/ocman/share.rb, line 9 def initialize(path) @path = path end
Public Instance Methods
Private Instance Methods
connection_headers(attributes = {})
click to toggle source
# File lib/ocman/share.rb, line 62 def connection_headers(attributes = {}) { 'OCS-APIRequest' => true, params: { path: attributes[:path], format: 'json' }.compact } end
connection_params(http_method, attributes = {})
click to toggle source
# File lib/ocman/share.rb, line 52 def connection_params(http_method, attributes = {}) { url: share_url(attributes[:id]), method: http_method, user: Ocman.configuration.user_name, password: Ocman.configuration.password, headers: connection_headers(attributes) } end
parse_result(response)
click to toggle source
# File lib/ocman/share.rb, line 48 def parse_result(response) Hashie::Mash.new(MultiJson.load(response)['ocs']) end