Module: FacebookAds::EdgeHasPost

Defined in:
lib/facebook_ads/edge.rb

Instance Method Summary collapse

Instance Method Details

#create(params) ⇒ Object



90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
# File 'lib/facebook_ads/edge.rb', line 90

def create(params)
  if self.class.param_set_for_post
    params = self.class.param_set_for_post.to_params(params)
  end

  node.post_edge(name, graph_params.merge(params)) do |response|
    # TODO params check
    # TODO Add new object to collection?
    
    field_type = self.class.return_types[:post]

    obj = field_type.deserialize(response, node.session)
    yield obj if block_given?
    obj
  end
end