Class: LiveJournal::Request::Friends
- Defined in:
- lib/livejournal/friends.rb
Instance Attribute Summary collapse
-
#friendofs ⇒ Object
readonly
Returns the value of attribute friendofs.
-
#friends ⇒ Object
readonly
Returns the value of attribute friends.
Instance Method Summary collapse
-
#initialize(user, opts = {}) ⇒ Friends
constructor
- Allowed options: :include_friendofs => true
-
also fill out @friendofs in single request.
-
#run ⇒ Object
Returns an array of LiveJournal::Friend.
Methods inherited from Req
#dryrun!, #dumpresponse, #verbose!
Constructor Details
#initialize(user, opts = {}) ⇒ Friends
Allowed options:
- :include_friendofs => true
-
also fill out @friendofs in single request
75 76 77 78 79 80 |
# File 'lib/livejournal/friends.rb', line 75 def initialize(user, opts={}) super(user, 'getfriends') @friends = nil @friendofs = nil @request['includefriendof'] = true if opts.has_key? :include_friendofs end |
Instance Attribute Details
#friendofs ⇒ Object (readonly)
Returns the value of attribute friendofs.
72 73 74 |
# File 'lib/livejournal/friends.rb', line 72 def friendofs @friendofs end |
#friends ⇒ Object (readonly)
Returns the value of attribute friends.
72 73 74 |
# File 'lib/livejournal/friends.rb', line 72 def friends @friends end |
Instance Method Details
#run ⇒ Object
Returns an array of LiveJournal::Friend.
82 83 84 85 86 87 |
# File 'lib/livejournal/friends.rb', line 82 def run super @friends = build_array('friend') { |r| Friend.new.from_request(r) } @friendofs = build_array('friendof') { |r| Friend.new.from_request(r) } @friends end |