class RestfulSharePoint::File
Public Instance Methods
content()
click to toggle source
# File lib/restful-sharepoint/objects/file.rb, line 8 def content @content ||= connection.get(url) end
endpoint()
click to toggle source
# File lib/restful-sharepoint/objects/file.rb, line 4 def endpoint "#{@parent.endpoint}/File" end
extension()
click to toggle source
# File lib/restful-sharepoint/objects/file.rb, line 31 def extension self['ServerRelativeUrl'].rpartition('.').last end
filename()
click to toggle source
# File lib/restful-sharepoint/objects/file.rb, line 27 def filename self['ServerRelativeUrl'].rpartition('/').last end
name()
click to toggle source
# File lib/restful-sharepoint/objects/file.rb, line 23 def name filename.rpartition('.').first end
size()
click to toggle source
In bytes
# File lib/restful-sharepoint/objects/file.rb, line 19 def size self['Length'] || content.length end
url()
click to toggle source
# File lib/restful-sharepoint/objects/file.rb, line 12 def url url = URI.parse(connection.site_url) url.path = URI.encode(self['ServerRelativeUrl']) url.to_s end