Class: LWS::Resource::Collection
- Inherits:
-
Generic::Model
- Object
- Spyke::Base
- Generic::Model
- LWS::Resource::Collection
- Defined in:
- lib/lws/apps/resource.rb
Overview
The collection class
There are two ways to view collections. Either it is viewed as a set of items with metadata (use #metadata and #items), or it is viewed as something that is associated with one or more meta collections that each have specific item objects (see for example #feed, #image, #images, etc.).
Defined Under Namespace
Classes: Feed, Image, Item, Post, Video, WeatherLocation
Collection Items Attribute Summary collapse
-
#feed ⇒ Collection::Feed
The feed that is part of the collection (if kind is
:feed
). -
#feeds ⇒ Array<Collection::Feed>
The feeds that are part of the collection (if kind is
:feeds
). -
#image ⇒ Collection::Image
The image that is part of the collection (if kind is
:image
). -
#images ⇒ Array<Collection::Image>
The images that are part of the collection (if kind is
:images
). -
#video ⇒ Collection::Video
The video that is part of the collection (if kind is
:video
). -
#videos ⇒ Array<Collection::Video>
The videos that are part of the collection (if kind is
:videos
). -
#weather_location ⇒ Collection::WeatherLocation
The weather collection that is part of the collection (if kind is
:weather_location
).
Instance Attribute Summary collapse
-
#account ⇒ LWS::Auth::Account
The account of the user that created the collection.
-
#account_id ⇒ Integer
The ID of the account of the user that created the collection.
-
#company ⇒ LWS::Auth::Company
The company the collection belongs to.
-
#company_id ⇒ Integer
The ID of the company the collection belongs to.
-
#email ⇒ String?
The email address used for email imports.
-
#folder ⇒ Folder
The folder that the collection is filed in.
-
#folder_id ⇒ Integer
The ID of the folder that the collection is filed in.
-
#items ⇒ Collection::Item
The returned object are of a class that is determined by the kind of this collection.
-
#kind ⇒ "feed", ...
The name of the class/kind of the collection.
-
#metadata ⇒ Hash
The metadata of the collection.
-
#name ⇒ String
The name of the collection.
-
#preview_url ⇒ String
The URL of a preview of the collection.
-
#uuid ⇒ String
The UUID used for unique file name generation.
Attributes inherited from Generic::Model
#created_at, #id, #updated_at, #url, #url_html
Method Summary
Methods inherited from Generic::Model
Instance Attribute Details
#account ⇒ LWS::Auth::Account
Returns the account of the user that created the collection.
51 |
# File 'lib/lws/apps/resource.rb', line 51 belongs_to :account, class_name: "LWS::Auth::Account" |
#account_id ⇒ Integer
Returns the ID of the account of the user that created the collection.
56 |
# File 'lib/lws/apps/resource.rb', line 56 attribute :account_id |
#company ⇒ LWS::Auth::Company
Returns the company the collection belongs to.
60 |
# File 'lib/lws/apps/resource.rb', line 60 belongs_to :company, class_name: "LWS::Auth::Company" |
#company_id ⇒ Integer
Returns the ID of the company the collection belongs to.
64 |
# File 'lib/lws/apps/resource.rb', line 64 attribute :company_id |
#email ⇒ String?
Returns the email address used for email imports.
68 |
# File 'lib/lws/apps/resource.rb', line 68 attribute :email |
#feed ⇒ Collection::Feed
Returns the feed that is part of the collection (if kind is :feed
).
113 |
# File 'lib/lws/apps/resource.rb', line 113 has_one :feed |
#feeds ⇒ Array<Collection::Feed>
Returns the feeds that are part of the collection (if kind is :feeds
).
118 |
# File 'lib/lws/apps/resource.rb', line 118 has_many :feeds |
#folder ⇒ Folder
Returns the folder that the collection is filed in.
72 |
# File 'lib/lws/apps/resource.rb', line 72 belongs_to :folder |
#folder_id ⇒ Integer
Returns the ID of the folder that the collection is filed in.
77 |
# File 'lib/lws/apps/resource.rb', line 77 attribute :folder_id |
#image ⇒ Collection::Image
Returns the image that is part of the collection (if kind is :image
).
123 |
# File 'lib/lws/apps/resource.rb', line 123 has_one :image |
#images ⇒ Array<Collection::Image>
Returns the images that are part of the collection (if kind is :images
).
128 |
# File 'lib/lws/apps/resource.rb', line 128 has_many :images |
#items ⇒ Collection::Item
The returned object are of a class that is determined by the kind of this collection.
84 |
# File 'lib/lws/apps/resource.rb', line 84 has_many :items, class_name: "LWS::Resource::Collection::Item" |
#kind ⇒ "feed", ...
Returns the name of the class/kind of the collection.
89 |
# File 'lib/lws/apps/resource.rb', line 89 attribute :kind |
#metadata ⇒ Hash
Returns the metadata of the collection.
93 |
# File 'lib/lws/apps/resource.rb', line 93 attribute :metadata |
#name ⇒ String
Returns the name of the collection.
97 |
# File 'lib/lws/apps/resource.rb', line 97 attribute :name |
#preview_url ⇒ String
Returns the URL of a preview of the collection.
101 |
# File 'lib/lws/apps/resource.rb', line 101 attribute :preview_url |
#uuid ⇒ String
Returns the UUID used for unique file name generation.
105 |
# File 'lib/lws/apps/resource.rb', line 105 attribute :uuid |
#video ⇒ Collection::Video
Returns the video that is part of the collection (if kind is :video
).
133 |
# File 'lib/lws/apps/resource.rb', line 133 has_one :video |
#videos ⇒ Array<Collection::Video>
Returns the videos that are part of the collection (if kind is :videos
).
138 |
# File 'lib/lws/apps/resource.rb', line 138 has_many :videos |
#weather_location ⇒ Collection::WeatherLocation
Returns the weather collection that is part of the collection (if kind is :weather_location
).
143 |
# File 'lib/lws/apps/resource.rb', line 143 has_one :weather_location |