Class: DocumentCloud::Project
- Inherits:
-
Object
- Object
- DocumentCloud::Project
- Defined in:
- lib/document_cloud/project.rb
Instance Attribute Summary collapse
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#title ⇒ Object
readonly
Returns the value of attribute title.
Instance Method Summary collapse
- #documents ⇒ Object
-
#initialize(attrs = {}) ⇒ Project
constructor
A new instance of Project.
Constructor Details
#initialize(attrs = {}) ⇒ Project
Returns a new instance of Project.
5 6 7 8 9 10 |
# File 'lib/document_cloud/project.rb', line 5 def initialize(attrs={}) @id = attrs[:id] @title = attrs[:title] @description = attrs[:description] @document_ids = attrs[:document_ids] end |
Instance Attribute Details
#description ⇒ Object (readonly)
Returns the value of attribute description.
3 4 5 |
# File 'lib/document_cloud/project.rb', line 3 def description @description end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
3 4 5 |
# File 'lib/document_cloud/project.rb', line 3 def id @id end |
#title ⇒ Object (readonly)
Returns the value of attribute title.
3 4 5 |
# File 'lib/document_cloud/project.rb', line 3 def title @title end |
Instance Method Details
#documents ⇒ Object
12 13 14 15 |
# File 'lib/document_cloud/project.rb', line 12 def documents @documents ||= @document_ids.map {|id| DocumentCloud.document(id) } @documents end |