Class: Flickr::Group

Inherits:
Object show all
Defined in:
lib/acts_as_unvlogable/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

#initialize(id_or_params_hash = nil, api_key = nil) ⇒ Group

Returns a new instance of Group.



655
656
657
658
659
660
661
662
663
# File 'lib/acts_as_unvlogable/flickr.rb', line 655

def initialize(id_or_params_hash=nil, api_key=nil)
  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

#clientObject (readonly)

, :chatid, :chatcount



653
654
655
# File 'lib/acts_as_unvlogable/flickr.rb', line 653

def client
  @client
end

#descriptionObject (readonly)

, :chatid, :chatcount



653
654
655
# File 'lib/acts_as_unvlogable/flickr.rb', line 653

def description
  @description
end

#eighteenplusObject (readonly)

, :chatid, :chatcount



653
654
655
# File 'lib/acts_as_unvlogable/flickr.rb', line 653

def eighteenplus
  @eighteenplus
end

#idObject (readonly)

, :chatid, :chatcount



653
654
655
# File 'lib/acts_as_unvlogable/flickr.rb', line 653

def id
  @id
end

#membersObject (readonly)

, :chatid, :chatcount



653
654
655
# File 'lib/acts_as_unvlogable/flickr.rb', line 653

def members
  @members
end

#nameObject (readonly)

, :chatid, :chatcount



653
654
655
# File 'lib/acts_as_unvlogable/flickr.rb', line 653

def name
  @name
end

#onlineObject (readonly)

, :chatid, :chatcount



653
654
655
# File 'lib/acts_as_unvlogable/flickr.rb', line 653

def online
  @online
end

#privacyObject (readonly)

, :chatid, :chatcount



653
654
655
# File 'lib/acts_as_unvlogable/flickr.rb', line 653

def privacy
  @privacy
end

#urlObject (readonly)

, :chatid, :chatcount



653
654
655
# File 'lib/acts_as_unvlogable/flickr.rb', line 653

def url
  @url
end

Instance Method Details

#getInfoObject

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



667
668
669
670
671
672
673
674
675
676
677
# File 'lib/acts_as_unvlogable/flickr.rb', line 667

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