class Siteleaf::SourceFile
Attributes
created_at[R]
download_url[R]
file[RW]
filesize[R]
name[RW]
sha[R]
site_id[RW]
type[R]
updated_at[R]
url[R]
user_id[R]
Public Instance Methods
create_endpoint()
click to toggle source
# File lib/siteleaf/source_file.rb, line 7 def create_endpoint uri = URI.encode(identifier) uri = uri.gsub('[', '%5B').gsub(']', '%5D') # workaround for https://bugs.ruby-lang.org/issues/12235 ::File.join('sites', site_id, 'source', uri) end
entity_endpoint()
click to toggle source
# File lib/siteleaf/source_file.rb, line 13 def entity_endpoint create_endpoint end
identifier()
click to toggle source
# File lib/siteleaf/source_file.rb, line 17 def identifier name end
to_file()
click to toggle source
# File lib/siteleaf/source_file.rb, line 21 def to_file Client.get("#{entity_endpoint}?download") end