Class: Copy::File
- Defined in:
- lib/copy/file.rb
Constant Summary collapse
- TYPES =
[ :file, :dir, :root, :copy, :inbox ]
Instance Attribute Summary collapse
-
#children ⇒ Object
Returns the value of attribute children.
-
#children_count ⇒ Object
Returns the value of attribute children_count.
-
#counts ⇒ Object
Returns the value of attribute counts.
-
#creator_id ⇒ Object
Returns the value of attribute creator_id.
-
#date_last_synced ⇒ Object
Returns the value of attribute date_last_synced.
-
#id ⇒ Object
Returns the value of attribute id.
-
#inbox_notifications ⇒ Object
Returns the value of attribute inbox_notifications.
-
#link_name ⇒ Object
Returns the value of attribute link_name.
-
#links ⇒ Object
Returns the value of attribute links.
-
#mime_type ⇒ Object
Returns the value of attribute mime_type.
-
#modified_time ⇒ Object
Returns the value of attribute modified_time.
-
#name ⇒ Object
Returns the value of attribute name.
-
#object_available ⇒ Object
Returns the value of attribute object_available.
-
#path ⇒ Object
Returns the value of attribute path.
-
#permissions ⇒ Object
Returns the value of attribute permissions.
-
#public ⇒ Object
Returns the value of attribute public.
-
#recipient_confirmed ⇒ Object
Returns the value of attribute recipient_confirmed.
-
#revision_id ⇒ Object
Returns the value of attribute revision_id.
-
#revisions ⇒ Object
Returns the value of attribute revisions.
-
#share ⇒ Object
Returns the value of attribute share.
-
#size ⇒ Object
Returns the value of attribute size.
-
#stub ⇒ Object
Returns the value of attribute stub.
-
#syncing ⇒ Object
Returns the value of attribute syncing.
-
#thumb ⇒ Object
Returns the value of attribute thumb.
-
#token ⇒ Object
Returns the value of attribute token.
-
#type ⇒ Object
Returns the value of attribute type.
-
#url ⇒ Object
Returns the value of attribute url.
Attributes inherited from Base
Class Method Summary collapse
-
.create(attrs) ⇒ Object
Create operation overwrite to parse file first.
Instance Method Summary collapse
-
#initialize(attributes = {}) ⇒ File
constructor
A new instance of File.
- #is_dir? ⇒ Boolean
- #parse_links ⇒ Object
- #stubbed? ⇒ Boolean
Methods included from Operations::Create
Methods included from Operations::Activity
Methods included from Operations::Delete
Methods included from Operations::Show
Methods inherited from Base
#errors, #parse_timestamps, #set_attributes, #valid?
Methods included from Operations::Base
Constructor Details
#initialize(attributes = {}) ⇒ File
Returns a new instance of File.
18 19 20 21 22 23 |
# File 'lib/copy/file.rb', line 18 def initialize(attributes = {}) super(attributes) parse_children parse_revisions parse_links end |
Instance Attribute Details
#children ⇒ Object
Returns the value of attribute children.
11 12 13 |
# File 'lib/copy/file.rb', line 11 def children @children end |
#children_count ⇒ Object
Returns the value of attribute children_count.
11 12 13 |
# File 'lib/copy/file.rb', line 11 def children_count @children_count end |
#counts ⇒ Object
Returns the value of attribute counts.
11 12 13 |
# File 'lib/copy/file.rb', line 11 def counts @counts end |
#creator_id ⇒ Object
Returns the value of attribute creator_id.
11 12 13 |
# File 'lib/copy/file.rb', line 11 def creator_id @creator_id end |
#date_last_synced ⇒ Object
Returns the value of attribute date_last_synced.
11 12 13 |
# File 'lib/copy/file.rb', line 11 def date_last_synced @date_last_synced end |
#id ⇒ Object
Returns the value of attribute id.
11 12 13 |
# File 'lib/copy/file.rb', line 11 def id @id end |
#inbox_notifications ⇒ Object
Returns the value of attribute inbox_notifications.
11 12 13 |
# File 'lib/copy/file.rb', line 11 def inbox_notifications @inbox_notifications end |
#link_name ⇒ Object
Returns the value of attribute link_name.
11 12 13 |
# File 'lib/copy/file.rb', line 11 def link_name @link_name end |
#links ⇒ Object
Returns the value of attribute links.
11 12 13 |
# File 'lib/copy/file.rb', line 11 def links @links end |
#mime_type ⇒ Object
Returns the value of attribute mime_type.
11 12 13 |
# File 'lib/copy/file.rb', line 11 def mime_type @mime_type end |
#modified_time ⇒ Object
Returns the value of attribute modified_time.
11 12 13 |
# File 'lib/copy/file.rb', line 11 def modified_time @modified_time end |
#name ⇒ Object
Returns the value of attribute name.
11 12 13 |
# File 'lib/copy/file.rb', line 11 def name @name end |
#object_available ⇒ Object
Returns the value of attribute object_available.
11 12 13 |
# File 'lib/copy/file.rb', line 11 def object_available @object_available end |
#path ⇒ Object
Returns the value of attribute path.
11 12 13 |
# File 'lib/copy/file.rb', line 11 def path @path end |
#permissions ⇒ Object
Returns the value of attribute permissions.
11 12 13 |
# File 'lib/copy/file.rb', line 11 def @permissions end |
#public ⇒ Object
Returns the value of attribute public.
11 12 13 |
# File 'lib/copy/file.rb', line 11 def public @public end |
#recipient_confirmed ⇒ Object
Returns the value of attribute recipient_confirmed.
11 12 13 |
# File 'lib/copy/file.rb', line 11 def recipient_confirmed @recipient_confirmed end |
#revision_id ⇒ Object
Returns the value of attribute revision_id.
11 12 13 |
# File 'lib/copy/file.rb', line 11 def revision_id @revision_id end |
#revisions ⇒ Object
Returns the value of attribute revisions.
11 12 13 |
# File 'lib/copy/file.rb', line 11 def revisions @revisions end |
#share ⇒ Object
Returns the value of attribute share.
11 12 13 |
# File 'lib/copy/file.rb', line 11 def share @share end |
#size ⇒ Object
Returns the value of attribute size.
11 12 13 |
# File 'lib/copy/file.rb', line 11 def size @size end |
#stub ⇒ Object
Returns the value of attribute stub.
11 12 13 |
# File 'lib/copy/file.rb', line 11 def stub @stub end |
#syncing ⇒ Object
Returns the value of attribute syncing.
11 12 13 |
# File 'lib/copy/file.rb', line 11 def syncing @syncing end |
#thumb ⇒ Object
Returns the value of attribute thumb.
11 12 13 |
# File 'lib/copy/file.rb', line 11 def thumb @thumb end |
#token ⇒ Object
Returns the value of attribute token.
11 12 13 |
# File 'lib/copy/file.rb', line 11 def token @token end |
#type ⇒ Object
Returns the value of attribute type.
11 12 13 |
# File 'lib/copy/file.rb', line 11 def type @type end |
#url ⇒ Object
Returns the value of attribute url.
11 12 13 |
# File 'lib/copy/file.rb', line 11 def url @url end |
Class Method Details
.create(attrs) ⇒ Object
Create operation overwrite to parse file first
65 66 67 |
# File 'lib/copy/file.rb', line 65 def create(attrs) super(parse_file(attrs)) end |
Instance Method Details
#is_dir? ⇒ Boolean
25 26 27 |
# File 'lib/copy/file.rb', line 25 def is_dir? type != 'file' end |
#parse_links ⇒ Object
53 54 55 56 57 58 59 60 |
# File 'lib/copy/file.rb', line 53 def parse_links return unless links results = [] links.each do |obj| results << Copy::Link.new(obj) end @links = results end |
#stubbed? ⇒ Boolean
29 30 31 |
# File 'lib/copy/file.rb', line 29 def stubbed? stub end |