Class: DearInventoryRuby::WebhookType

Inherits:
Object
  • Object
show all
Defined in:
lib/dear-inventory-ruby/models/webhook_type.rb

Constant Summary collapse

SALE_QUOTE_AUTHORISED =
"Sale/QuoteAuthorised".freeze
SALE_ORDER_AUTHORISED =
"Sale/OrderAuthorised".freeze
SALE_VOIDED =
"Sale/Voided".freeze
SALE_BACKORDERED =
"Sale/Backordered".freeze
SALE_SHIPMENT_AUTHORISED =
"Sale/ShipmentAuthorised".freeze
SALE_INVOICE_AUTHORISED =
"Sale/InvoiceAuthorised".freeze
SALE_PICK_AUTHORISED =
"Sale/PickAuthorised".freeze
SALE_PACK_AUTHORISED =
"Sale/PackAuthorised".freeze
SALE_CREDIT_NOTE_AUTHORISED =
"Sale/CreditNoteAuthorised".freeze
SALE_UNDO =
"Sale/Undo".freeze
SALE_PARTIAL_PAYMENT_RECEIVED =
"Sale/PartialPaymentReceived".freeze
SALE_FULL_PAYMENT_RECEIVED =
"Sale/FullPaymentReceived".freeze
SALE_SHIPMENT_TRACKING_NUMBER_CHANGED =
"Sale/ShipmentTrackingNumberChanged".freeze
PURCHASE_ORDER_AUTHORISED =
"Purchase/OrderAuthorised".freeze
PURCHASE_INVOICE_AUTHORISED =
"Purchase/InvoiceAuthorised".freeze
PURCHASE_STOCK_RECEIVED_AUTHORISED =
"Purchase/StockReceivedAuthorised".freeze
PURCHASE_CREDIT_NOTE_AUTHORISED =
"Purchase/CreditNoteAuthorised".freeze
CUSTOMER_UPDATED =
"Customer/Updated".freeze
SUPPLIER_UPDATED =
"Supplier/Updated".freeze
STOCK_AVAILABLE_STOCK_LEVEL_CHANGED =
"Stock/AvailableStockLevelChanged".freeze

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.build_from_hash(value) ⇒ String

Builds the enum from string

Parameters:

  • The (String)

    enum value in the form of the string

Returns:

  • (String)

    The enum value



41
42
43
# File 'lib/dear-inventory-ruby/models/webhook_type.rb', line 41

def self.build_from_hash(value)
  new.build_from_hash(value)
end

Instance Method Details

#build_from_hash(value) ⇒ String

Builds the enum from string

Parameters:

  • The (String)

    enum value in the form of the string

Returns:

  • (String)

    The enum value



48
49
50
51
52
# File 'lib/dear-inventory-ruby/models/webhook_type.rb', line 48

def build_from_hash(value)
  constantValues = WebhookType.constants.select { |c| WebhookType::const_get(c) == value }
  raise "Invalid ENUM value #{value} for class #WebhookType" if constantValues.empty?
  value
end