Class: Zaikio::Warehouse::Base

Inherits:
Client::Model
  • Object
show all
Defined in:
lib/zaikio/warehouse/base.rb

Overview

Base class for Zaikio Warehouse models

Class Method Summary collapse

Class Method Details

.disable_http_methods(*disabled_methods) ⇒ Object



18
19
20
# File 'lib/zaikio/warehouse/base.rb', line 18

def disable_http_methods(*disabled_methods)
  self.allowed_methods -= disabled_methods
end

.readonly!Object



14
15
16
# File 'lib/zaikio/warehouse/base.rb', line 14

def readonly!
  self.allowed_methods = %i[get]
end

.request(method, *args, **opts) ⇒ Object

Raises:

  • (Zaikio::Error)


22
23
24
25
26
# File 'lib/zaikio/warehouse/base.rb', line 22

def request(method, *args, **opts)
  raise Zaikio::Error, "HTTP method #{method} is not allowed on #{self}" unless allowed_methods.include?(method)

  super
end