Class: Wuclan::JsonModel::FfIdsParser

Inherits:
GenericJsonParser show all
Defined in:
lib/wuclan/twitter/parse/ff_ids_parser.rb

Overview

Public timeline is an array of tweets => users

Instance Attribute Summary

Attributes inherited from GenericJsonParser

#raw

Instance Method Summary collapse

Methods inherited from GenericJsonParser

#initialize, new_from_json

Constructor Details

This class inherits a constructor from Wuclan::JsonModel::GenericJsonParser

Instance Method Details

#each(&block) ⇒ Object



16
17
18
19
20
21
22
23
24
# File 'lib/wuclan/twitter/parse/ff_ids_parser.rb', line 16

def each &block
  contents.each do |user_b_id|
    user_b_id = "%010d"%user_b_id.to_i
    case context.to_s
    when 'followers_ids' then yield AFollowsB.new(user_b_id, user_a_id)
    when 'friends_ids'   then yield AFollowsB.new(user_a_id, user_b_id)
    end
  end
end

#healthy?Boolean

friends_ids or followers_ids is an array of user_id’s

Returns:

  • (Boolean)


12
13
14
# File 'lib/wuclan/twitter/parse/ff_ids_parser.rb', line 12

def healthy?()
  contents && contents.is_a?(Array)
end