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

Defined Under Namespace

Modules: ClassMethods

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(base) ⇒ Object



6
7
8
# File 'lib/adparlor/facebook/graph_api/traits/methods.rb', line 6

def self.included(base)
  base.extend(ClassMethods)
end

Instance Method Details

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

Raises:



10
11
12
13
14
# File 'lib/adparlor/facebook/graph_api/traits/methods.rb', line 10

def create(attributes = {}, options = {})
  allowed_methods = self.class.allowed_methods
  raise FbError.new('create not available', 500) unless allowed_methods && allowed_methods.include?(:create)
  super(attributes, options)
end

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

Raises:



16
17
18
19
20
# File 'lib/adparlor/facebook/graph_api/traits/methods.rb', line 16

def destroy(path, options = {})
  allowed_methods = self.class.allowed_methods
  raise FbError.new('destroy not available', 500) unless allowed_methods && allowed_methods.include?(:destroy)
  super(path, options)
end

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

Raises:



22
23
24
25
26
# File 'lib/adparlor/facebook/graph_api/traits/methods.rb', line 22

def update(attributes = {}, options = {})
  allowed_methods = self.class.allowed_methods
  raise FbError.new('update not available', 500) unless allowed_methods && allowed_methods.include?(:update)
  super(attributes, options)
end