Class: Bigcommerce::ResourceActions

Inherits:
Module
  • Object
show all
Defined in:
lib/bigcommerce/resource_actions.rb

Direct Known Subclasses

SubresourceActions

Defined Under Namespace

Modules: ClassMethods

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ ResourceActions

Returns a new instance of ResourceActions.


5
6
7
8
9
10
11
12
# File 'lib/bigcommerce/resource_actions.rb', line 5

def initialize(options = {})
  @options = options
  tap do |mod|
    mod.define_singleton_method :_options do
      mod.options
    end
  end
end

Instance Attribute Details

#optionsObject (readonly)

Returns the value of attribute options


3
4
5
# File 'lib/bigcommerce/resource_actions.rb', line 3

def options
  @options
end

Instance Method Details

#included(base) ⇒ Object


14
15
16
17
18
19
20
# File 'lib/bigcommerce/resource_actions.rb', line 14

def included(base)
  base.send(:include, Request.new(options[:uri]))
  base.extend(ClassMethods)
  options[:disable_methods] ||= []
  methods = ClassMethods.public_instance_methods & options[:disable_methods]
  methods.each { |name| base.send(:remove_method, name) }
end