Class: AdvancedBilling::MetafieldInput

Inherits:
Object
  • Object
show all
Defined in:
lib/advanced_billing/models/metafield_input.rb

Overview

Indicates how data should be added to the metafield. For example, a text type is just a string, so a given metafield of this type can have any value attached. On the other hand, dropdown and radio have a set of allowed values that can be input, and appear differently on a Public Signup Page. Defaults to ‘text’

Constant Summary collapse

METAFIELD_INPUT =
[
  # TODO: Write general description for BALANCE_TRACKER
  BALANCE_TRACKER = 'balance_tracker'.freeze,

  # TODO: Write general description for TEXT
  TEXT = 'text'.freeze,

  # TODO: Write general description for RADIO
  RADIO = 'radio'.freeze,

  # TODO: Write general description for DROPDOWN
  DROPDOWN = 'dropdown'.freeze
].freeze

Class Method Summary collapse

Class Method Details

.validate(value) ⇒ Object



27
28
29
30
31
# File 'lib/advanced_billing/models/metafield_input.rb', line 27

def self.validate(value)
  return false if value.nil?

  METAFIELD_INPUT.include?(value)
end