Class: RubyMetaGraph::Me

Inherits:
Object
  • Object
show all
Includes:
RubyMetaGraph
Defined in:
lib/ruby_meta_graph/me.rb

Constant Summary

Constants included from RubyMetaGraph

BASE_URL, VERSION

Instance Method Summary collapse

Methods included from RubyMetaGraph

#connect

Constructor Details

#initialize(fields, access) ⇒ Me

Returns a new instance of Me.



5
6
7
8
# File 'lib/ruby_meta_graph/me.rb', line 5

def initialize(fields, access)
  @fields = fields
  @access = access
end

Instance Method Details

#runObject



10
11
12
13
14
15
16
17
18
19
# File 'lib/ruby_meta_graph/me.rb', line 10

def run
  response = connect.get(
    "me", {
      fields: @fields,
      access_token: @access
    }
  )

  return JSON.parse(response.body, object_class: OpenStruct)
end