Method: FBCLI.api_call

Defined in:
lib/fbcli/api.rb

.api_call(lambda) ⇒ Object



29
30
31
32
33
34
35
36
37
# File 'lib/fbcli/api.rb', line 29

def self.api_call(lambda)
  @@api = init_api if @@api.nil?

  begin
    lambda.call(@@api)
  rescue Koala::Facebook::APIError => e
    exit_now! koala_error_str e
  end
end