Class: AudioVision::Bucket
Instance Attribute Summary collapse
-
#description ⇒ Object
Returns the value of attribute description.
-
#id ⇒ Object
Returns the value of attribute id.
-
#posts ⇒ Object
Returns the value of attribute posts.
-
#title ⇒ Object
Returns the value of attribute title.
-
#updated_at ⇒ Object
Returns the value of attribute updated_at.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(attributes = {}) ⇒ Bucket
constructor
A new instance of Bucket.
Methods inherited from Base
#==, api_path, collection, find
Constructor Details
#initialize(attributes = {}) ⇒ Bucket
Returns a new instance of Bucket.
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/audio_vision/bucket.rb', line 21 def initialize(attributes={}) @id = attributes["id"] @title = attributes["title"] @description = attributes["description"] if attributes["updated_at"] @updated_at = Time.parse(attributes["updated_at"].to_s) end @posts = [] Array(attributes["posts"]).each do |json| @posts << AudioVision::Post.new(json) end end |
Instance Attribute Details
#description ⇒ Object
Returns the value of attribute description.
13 14 15 |
# File 'lib/audio_vision/bucket.rb', line 13 def description @description end |
#id ⇒ Object
Returns the value of attribute id.
13 14 15 |
# File 'lib/audio_vision/bucket.rb', line 13 def id @id end |
#posts ⇒ Object
Returns the value of attribute posts.
13 14 15 |
# File 'lib/audio_vision/bucket.rb', line 13 def posts @posts end |
#title ⇒ Object
Returns the value of attribute title.
13 14 15 |
# File 'lib/audio_vision/bucket.rb', line 13 def title @title end |
#updated_at ⇒ Object
Returns the value of attribute updated_at.
13 14 15 |
# File 'lib/audio_vision/bucket.rb', line 13 def updated_at @updated_at end |
Class Method Details
.api_namespace ⇒ Object
5 6 7 |
# File 'lib/audio_vision/bucket.rb', line 5 def api_namespace :buckets end |