Class: RedboothRuby::File
- Includes:
- Operations::Create, Operations::Delete, Operations::Index, Operations::Show, Operations::Update
- Defined in:
- lib/redbooth-ruby/file.rb
Instance Attribute Summary collapse
-
#backend ⇒ Object
Returns the value of attribute backend.
-
#backend_id ⇒ Object
Returns the value of attribute backend_id.
-
#created_at ⇒ Object
Returns the value of attribute created_at.
-
#id ⇒ Object
Returns the value of attribute id.
-
#is_dir ⇒ Object
Returns the value of attribute is_dir.
-
#is_downloadable ⇒ Object
Returns the value of attribute is_downloadable.
-
#is_previewable ⇒ Object
Returns the value of attribute is_previewable.
-
#is_private ⇒ Object
Returns the value of attribute is_private.
-
#mime_type ⇒ Object
Returns the value of attribute mime_type.
-
#name ⇒ Object
Returns the value of attribute name.
-
#parent_id ⇒ Object
Returns the value of attribute parent_id.
-
#pinned ⇒ Object
Returns the value of attribute pinned.
-
#project_id ⇒ Object
Returns the value of attribute project_id.
-
#public_token ⇒ Object
Returns the value of attribute public_token.
-
#size ⇒ Object
Returns the value of attribute size.
-
#updated_at ⇒ Object
Returns the value of attribute updated_at.
-
#user_id ⇒ Object
Returns the value of attribute user_id.
Attributes inherited from Base
Class Method Summary collapse
-
.create(attrs) ⇒ Object
Create operation overwrite to parse file first.
Instance Method Summary collapse
-
#download(style = 'original', path = nil) ⇒ String
Returns a blop with the file data.
Methods included from Operations::Delete
Methods included from Operations::Show
Methods included from Operations::Update
Methods included from Operations::Create
Methods included from Operations::Index
Methods inherited from Base
#errors, #initialize, #parse_timestamps, #set_attributes, #valid?
Methods included from Operations::Base
Constructor Details
This class inherits a constructor from RedboothRuby::Base
Instance Attribute Details
#backend ⇒ Object
Returns the value of attribute backend.
9 10 11 |
# File 'lib/redbooth-ruby/file.rb', line 9 def backend @backend end |
#backend_id ⇒ Object
Returns the value of attribute backend_id.
9 10 11 |
# File 'lib/redbooth-ruby/file.rb', line 9 def backend_id @backend_id end |
#created_at ⇒ Object
Returns the value of attribute created_at.
9 10 11 |
# File 'lib/redbooth-ruby/file.rb', line 9 def created_at @created_at end |
#id ⇒ Object
Returns the value of attribute id.
9 10 11 |
# File 'lib/redbooth-ruby/file.rb', line 9 def id @id end |
#is_dir ⇒ Object
Returns the value of attribute is_dir.
9 10 11 |
# File 'lib/redbooth-ruby/file.rb', line 9 def is_dir @is_dir end |
#is_downloadable ⇒ Object
Returns the value of attribute is_downloadable.
9 10 11 |
# File 'lib/redbooth-ruby/file.rb', line 9 def is_downloadable @is_downloadable end |
#is_previewable ⇒ Object
Returns the value of attribute is_previewable.
9 10 11 |
# File 'lib/redbooth-ruby/file.rb', line 9 def is_previewable @is_previewable end |
#is_private ⇒ Object
Returns the value of attribute is_private.
9 10 11 |
# File 'lib/redbooth-ruby/file.rb', line 9 def is_private @is_private end |
#mime_type ⇒ Object
Returns the value of attribute mime_type.
9 10 11 |
# File 'lib/redbooth-ruby/file.rb', line 9 def mime_type @mime_type end |
#name ⇒ Object
Returns the value of attribute name.
9 10 11 |
# File 'lib/redbooth-ruby/file.rb', line 9 def name @name end |
#parent_id ⇒ Object
Returns the value of attribute parent_id.
9 10 11 |
# File 'lib/redbooth-ruby/file.rb', line 9 def parent_id @parent_id end |
#pinned ⇒ Object
Returns the value of attribute pinned.
9 10 11 |
# File 'lib/redbooth-ruby/file.rb', line 9 def pinned @pinned end |
#project_id ⇒ Object
Returns the value of attribute project_id.
9 10 11 |
# File 'lib/redbooth-ruby/file.rb', line 9 def project_id @project_id end |
#public_token ⇒ Object
Returns the value of attribute public_token.
9 10 11 |
# File 'lib/redbooth-ruby/file.rb', line 9 def public_token @public_token end |
#size ⇒ Object
Returns the value of attribute size.
9 10 11 |
# File 'lib/redbooth-ruby/file.rb', line 9 def size @size end |
#updated_at ⇒ Object
Returns the value of attribute updated_at.
9 10 11 |
# File 'lib/redbooth-ruby/file.rb', line 9 def updated_at @updated_at end |
#user_id ⇒ Object
Returns the value of attribute user_id.
9 10 11 |
# File 'lib/redbooth-ruby/file.rb', line 9 def user_id @user_id end |
Class Method Details
.create(attrs) ⇒ Object
Create operation overwrite to parse file first
41 42 43 |
# File 'lib/redbooth-ruby/file.rb', line 41 def create(attrs) super(parse_file(attrs)) end |
Instance Method Details
#download(style = 'original', path = nil) ⇒ String
Returns a blop with the file data
32 33 34 35 36 37 |
# File 'lib/redbooth-ruby/file.rb', line 32 def download(style='original', path=nil) = { session: session } [:download_path] = path unless path.nil? request = RedboothRuby.request(:download, nil, "files/#{id}/download/#{style}/#{name}", {}, ) request.body end |