Class: Orb::Models::Minimum::Filter

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/orb/models/minimum.rb,
sig/orb/models/minimum.rbs

Defined Under Namespace

Modules: Field, Operator

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Internal::Type::BaseModel

==, #==, #[], coerce, #deconstruct_keys, #deep_to_h, dump, fields, hash, #hash, inherited, inspect, #inspect, known_fields, optional, recursively_to_h, required, #to_h, #to_json, #to_s, to_sorbet_type, #to_yaml

Methods included from Internal::Type::Converter

#coerce, coerce, #dump, dump, #inspect, inspect, meta_info, new_coerce_state, type_info

Methods included from Internal::Util::SorbetRuntimeSupport

#const_missing, #define_sorbet_constant!, #sorbet_constant_defined?, #to_sorbet_type, to_sorbet_type

Constructor Details

#initialize(field:, operator:, values:) ⇒ Object

Parameters:



37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
# File 'lib/orb/models/minimum.rb', line 37

class Filter < Orb::Internal::Type::BaseModel
  # @!attribute field
  #   The property of the price to filter on.
  #
  #   @return [Symbol, Orb::Models::Minimum::Filter::Field]
  required :field, enum: -> { Orb::Minimum::Filter::Field }

  # @!attribute operator
  #   Should prices that match the filter be included or excluded.
  #
  #   @return [Symbol, Orb::Models::Minimum::Filter::Operator]
  required :operator, enum: -> { Orb::Minimum::Filter::Operator }

  # @!attribute values
  #   The IDs or values that match this filter.
  #
  #   @return [Array<String>]
  required :values, Orb::Internal::Type::ArrayOf[String]

  # @!method initialize(field:, operator:, values:)
  #   @param field [Symbol, Orb::Models::Minimum::Filter::Field] The property of the price to filter on.
  #
  #   @param operator [Symbol, Orb::Models::Minimum::Filter::Operator] Should prices that match the filter be included or excluded.
  #
  #   @param values [Array<String>] The IDs or values that match this filter.

  # The property of the price to filter on.
  #
  # @see Orb::Models::Minimum::Filter#field
  module Field
    extend Orb::Internal::Type::Enum

    PRICE_ID = :price_id
    ITEM_ID = :item_id
    PRICE_TYPE = :price_type
    CURRENCY = :currency
    PRICING_UNIT_ID = :pricing_unit_id

    # @!method self.values
    #   @return [Array<Symbol>]
  end

  # Should prices that match the filter be included or excluded.
  #
  # @see Orb::Models::Minimum::Filter#operator
  module Operator
    extend Orb::Internal::Type::Enum

    INCLUDES = :includes
    EXCLUDES = :excludes

    # @!method self.values
    #   @return [Array<Symbol>]
  end
end

Instance Attribute Details

#fieldSymbol, Orb::Models::Minimum::Filter::Field

The property of the price to filter on.

Parameters:

  • value (Orb::Models::Minimum::Filter::field)

Returns:



42
# File 'lib/orb/models/minimum.rb', line 42

required :field, enum: -> { Orb::Minimum::Filter::Field }

#operatorSymbol, Orb::Models::Minimum::Filter::Operator

Should prices that match the filter be included or excluded.

Parameters:

  • value (Orb::Models::Minimum::Filter::operator)

Returns:



48
# File 'lib/orb/models/minimum.rb', line 48

required :operator, enum: -> { Orb::Minimum::Filter::Operator }

#valuesArray<String>

The IDs or values that match this filter.

Parameters:

  • value (::Array[String])

Returns:

  • (Array<String>)


54
# File 'lib/orb/models/minimum.rb', line 54

required :values, Orb::Internal::Type::ArrayOf[String]

Class Method Details

.valuesArray<Symbol>

Returns:

  • (Array<Symbol>)


# File 'lib/orb/models/minimum.rb', line 75

Instance Method Details

#to_hash{

Returns:

  • ({)


49
# File 'sig/orb/models/minimum.rbs', line 49

def to_hash: -> {