Class: Siteleaf::SourceFile
- Defined in:
- lib/siteleaf/source_file.rb
Instance Attribute Summary collapse
-
#created_at ⇒ Object
readonly
Returns the value of attribute created_at.
-
#download_url ⇒ Object
readonly
Returns the value of attribute download_url.
-
#file ⇒ Object
Returns the value of attribute file.
-
#filesize ⇒ Object
readonly
Returns the value of attribute filesize.
-
#name ⇒ Object
Returns the value of attribute name.
-
#sha ⇒ Object
readonly
Returns the value of attribute sha.
-
#site_id ⇒ Object
Returns the value of attribute site_id.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
-
#updated_at ⇒ Object
readonly
Returns the value of attribute updated_at.
-
#url ⇒ Object
readonly
Returns the value of attribute url.
-
#user_id ⇒ Object
readonly
Returns the value of attribute user_id.
Attributes inherited from Entity
Instance Method Summary collapse
Methods inherited from Entity
all, #attributes, #attributes=, class_name, create, delete, #delete, endpoint, find, #initialize, #save
Constructor Details
This class inherits a constructor from Siteleaf::Entity
Instance Attribute Details
#created_at ⇒ Object (readonly)
Returns the value of attribute created_at.
5 6 7 |
# File 'lib/siteleaf/source_file.rb', line 5 def created_at @created_at end |
#download_url ⇒ Object (readonly)
Returns the value of attribute download_url.
5 6 7 |
# File 'lib/siteleaf/source_file.rb', line 5 def download_url @download_url end |
#file ⇒ Object
Returns the value of attribute file.
4 5 6 |
# File 'lib/siteleaf/source_file.rb', line 4 def file @file end |
#filesize ⇒ Object (readonly)
Returns the value of attribute filesize.
5 6 7 |
# File 'lib/siteleaf/source_file.rb', line 5 def filesize @filesize end |
#name ⇒ Object
Returns the value of attribute name.
4 5 6 |
# File 'lib/siteleaf/source_file.rb', line 4 def name @name end |
#sha ⇒ Object (readonly)
Returns the value of attribute sha.
5 6 7 |
# File 'lib/siteleaf/source_file.rb', line 5 def sha @sha end |
#site_id ⇒ Object
Returns the value of attribute site_id.
4 5 6 |
# File 'lib/siteleaf/source_file.rb', line 4 def site_id @site_id end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
5 6 7 |
# File 'lib/siteleaf/source_file.rb', line 5 def type @type end |
#updated_at ⇒ Object (readonly)
Returns the value of attribute updated_at.
5 6 7 |
# File 'lib/siteleaf/source_file.rb', line 5 def updated_at @updated_at end |
#url ⇒ Object (readonly)
Returns the value of attribute url.
5 6 7 |
# File 'lib/siteleaf/source_file.rb', line 5 def url @url end |
#user_id ⇒ Object (readonly)
Returns the value of attribute user_id.
5 6 7 |
# File 'lib/siteleaf/source_file.rb', line 5 def user_id @user_id end |
Instance Method Details
#create_endpoint ⇒ Object
7 8 9 10 11 |
# File 'lib/siteleaf/source_file.rb', line 7 def create_endpoint uri = URI::Parser.new.escape(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 ⇒ Object
13 14 15 |
# File 'lib/siteleaf/source_file.rb', line 13 def entity_endpoint create_endpoint end |
#identifier ⇒ Object
17 18 19 |
# File 'lib/siteleaf/source_file.rb', line 17 def identifier name end |