Module: Adparlor::Facebook::GraphApi::Traits::Methods::ClassMethods

Defined in:
lib/adparlor/facebook/graph_api/traits/methods.rb

Instance Method Summary collapse

Instance Method Details

#allow_local_method(*args) ⇒ Object



29
30
31
# File 'lib/adparlor/facebook/graph_api/traits/methods.rb', line 29

def allow_local_method(*args)
  @allowed_local_methods = args
end

#allow_method(*args) ⇒ Object



33
34
35
# File 'lib/adparlor/facebook/graph_api/traits/methods.rb', line 33

def allow_method(*args)
  @allowed_methods = args
end

#allowed_local_methodsObject



37
38
39
# File 'lib/adparlor/facebook/graph_api/traits/methods.rb', line 37

def allowed_local_methods
  @allowed_local_methods
end

#allowed_methodsObject



41
42
43
# File 'lib/adparlor/facebook/graph_api/traits/methods.rb', line 41

def allowed_methods
  @allowed_methods
end

#create(path, options = {}) ⇒ Object

Raises:



45
46
47
48
# File 'lib/adparlor/facebook/graph_api/traits/methods.rb', line 45

def create(path, options = {})
  raise FbError.new('create not available', 500) unless @allowed_local_methods && @allowed_local_methods.include?(:create)
  super(path, options)
end

#destroy(path, options = {}) ⇒ Object

Raises:



50
51
52
53
# File 'lib/adparlor/facebook/graph_api/traits/methods.rb', line 50

def destroy(path, options = {})
  raise FbError.new('destroy not available, use soft delete update', 500) unless @allowed_local_methods && @allowed_local_methods.include?(:destroy)
  super(path, options)
end

#update(path, options = {}) ⇒ Object

Raises:



55
56
57
58
# File 'lib/adparlor/facebook/graph_api/traits/methods.rb', line 55

def update(path, options = {})
  raise FbError.new('update not available', 500) unless @allowed_local_methods && @allowed_local_methods.include?(:update)
  super(path, options)
end