Class: Yandex::Disk::Client::Request::Publication

Inherits:
Object
  • Object
show all
Defined in:
lib/yandex/disk/client/request/publication.rb

Defined Under Namespace

Classes: AttributesParser

Constant Summary collapse

BODY =
'<propertyupdate xmlns="DAV:">
  <set>
    <prop>
      <public_url xmlns="urn:yandex:disk:meta">true</public_url>
    </prop>
  </set>
</propertyupdate>'
HEADERS =
{
}

Instance Method Summary collapse

Constructor Details

#initialize(http, path) ⇒ Publication

Returns a new instance of Publication.



15
16
17
18
# File 'lib/yandex/disk/client/request/publication.rb', line 15

def initialize http, path
  @http = http
  @path = path
end

Instance Method Details

#performObject



20
21
22
23
24
# File 'lib/yandex/disk/client/request/publication.rb', line 20

def perform
  response = @http.run_request :proppatch, @path, BODY, HEADERS
  parse_result = parse(response.body)
  { :public_url => parse_result.public_url }
end