Class: Flickr::Group

Inherits:
Object
  • Object
show all
Defined in:
lib/flickr.rb

Overview

Todo: flickr.groups.pools.add flickr.groups.pools.getContext flickr.groups.pools.getGroups flickr.groups.pools.getPhotos flickr.groups.pools.remove

Instance Attribute Summary (collapse)

Instance Method Summary (collapse)

Constructor Details

- (Group) initialize(id_or_params_hash = nil, api_key = {})

Returns a new instance of Group



685
686
687
688
689
690
691
692
693
# File 'lib/flickr.rb', line 685

def initialize(id_or_params_hash=nil, api_key={})
  if id_or_params_hash.is_a?(Hash)
    id_or_params_hash.each { |k,v| self.instance_variable_set("@#{k}", v) } # convert extra_params into instance variables
  else
    @id = id_or_params_hash
    @api_key = api_key
    @client = Flickr.new @api_key
  end
end

Instance Attribute Details

- (Object) client (readonly)

, :chatid, :chatcount



683
684
685
# File 'lib/flickr.rb', line 683

def client
  @client
end

- (Object) description (readonly)

, :chatid, :chatcount



683
684
685
# File 'lib/flickr.rb', line 683

def description
  @description
end

- (Object) eighteenplus (readonly)

, :chatid, :chatcount



683
684
685
# File 'lib/flickr.rb', line 683

def eighteenplus
  @eighteenplus
end

- (Object) id (readonly)

, :chatid, :chatcount



683
684
685
# File 'lib/flickr.rb', line 683

def id
  @id
end

- (Object) members (readonly)

, :chatid, :chatcount



683
684
685
# File 'lib/flickr.rb', line 683

def members
  @members
end

- (Object) name (readonly)

, :chatid, :chatcount



683
684
685
# File 'lib/flickr.rb', line 683

def name
  @name
end

- (Object) online (readonly)

, :chatid, :chatcount



683
684
685
# File 'lib/flickr.rb', line 683

def online
  @online
end

- (Object) privacy (readonly)

, :chatid, :chatcount



683
684
685
# File 'lib/flickr.rb', line 683

def privacy
  @privacy
end

- (Object) url (readonly)

, :chatid, :chatcount



683
684
685
# File 'lib/flickr.rb', line 683

def url
  @url
end

Instance Method Details

- (Object) getInfo

Implements flickr.groups.getInfo and flickr.urls.getGroup private, once we can call it as needed



697
698
699
700
701
702
703
704
705
706
707
# File 'lib/flickr.rb', line 697

def getInfo
  info = @client.groups_getInfo('group_id'=>@id)['group']
  @name = info['name']
  @members = info['members']
  @online = info['online']
  @privacy = info['privacy']
  # @chatid = info['chatid']
  # @chatcount = info['chatcount']
  @url = @client.urls_getGroup('group_id'=>@id)['group']['url']
  self
end