Module: FacebookAds::EdgeHasPost

Defined in:
lib/facebook_ads/edge.rb

Instance Method Summary collapse

Instance Method Details

#create(params) ⇒ Object



79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
# File 'lib/facebook_ads/edge.rb', line 79

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