Class: AudioVision::Bucket

Inherits:
Base
  • Object
show all
Defined in:
lib/audio_vision/bucket.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

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

#descriptionObject

Returns the value of attribute description.



13
14
15
# File 'lib/audio_vision/bucket.rb', line 13

def description
  @description
end

#idObject

Returns the value of attribute id.



13
14
15
# File 'lib/audio_vision/bucket.rb', line 13

def id
  @id
end

#postsObject

Returns the value of attribute posts.



13
14
15
# File 'lib/audio_vision/bucket.rb', line 13

def posts
  @posts
end

#titleObject

Returns the value of attribute title.



13
14
15
# File 'lib/audio_vision/bucket.rb', line 13

def title
  @title
end

#updated_atObject

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_namespaceObject



5
6
7
# File 'lib/audio_vision/bucket.rb', line 5

def api_namespace
  :buckets
end