Class: RhoGallery::Group

Inherits:
Base
  • Object
show all
Defined in:
lib/rhogallery/group.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#errors, #id, #initialize

Constructor Details

This class inherits a constructor from RhoGallery::Base

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class RhoGallery::Base

Class Method Details

.find(id, options = RhoGallery.credentials) ⇒ Object



24
25
26
27
# File 'lib/rhogallery/group.rb', line 24

def self.find(id, options = RhoGallery.credentials)
  group = RhoGallery::Base.find(id, options, "groups")
  RhoGallery::Group.new(RhoGallery.prepare_hash(group))
end

.find_all(options = RhoGallery.credentials) ⇒ Object



19
20
21
22
# File 'lib/rhogallery/group.rb', line 19

def self.find_all(options = RhoGallery.credentials)
  groups = RhoGallery::Base.find_all(options, "groups")
  groups.collect!{|group| RhoGallery::Group.new(RhoGallery.prepare_hash(group))} unless groups.empty?
end

Instance Method Details

#create(data = @attributes, options = RhoGallery.credentials, resource = "groups") ⇒ Object



3
4
5
# File 'lib/rhogallery/group.rb', line 3

def create(data = @attributes, options = RhoGallery.credentials, resource = "groups")
  super(data, options, resource)
end

#delete(options = RhoGallery.credentials, resource = "groups/#{self.id}") ⇒ Object



15
16
17
# File 'lib/rhogallery/group.rb', line 15

def delete(options = RhoGallery.credentials, resource = "groups/#{self.id}")
  super(options, resource)
end

#save(data = @attributes, options = RhoGallery.credentials, resource = "groups") ⇒ Object



7
8
9
# File 'lib/rhogallery/group.rb', line 7

def save(data = @attributes, options = RhoGallery.credentials, resource = "groups")
  super(data, options, resource)
end

#update(data = @attributes, options = RhoGallery.credentials) ⇒ Object



11
12
13
# File 'lib/rhogallery/group.rb', line 11

def update(data = @attributes, options = RhoGallery.credentials)
  method_missing(:update)
end