Module: DynamoidAdvancedWhere::Nodes

Defined in:
lib/dynamoid_advanced_where/nodes/not.rb,
lib/dynamoid_advanced_where/nodes/in_node.rb,
lib/dynamoid_advanced_where/nodes/or_node.rb,
lib/dynamoid_advanced_where/nodes/and_node.rb,
lib/dynamoid_advanced_where/nodes/includes.rb,
lib/dynamoid_advanced_where/nodes/subfield.rb,
lib/dynamoid_advanced_where/nodes/base_node.rb,
lib/dynamoid_advanced_where/nodes/null_node.rb,
lib/dynamoid_advanced_where/nodes/root_node.rb,
lib/dynamoid_advanced_where/nodes/field_node.rb,
lib/dynamoid_advanced_where/nodes/exists_node.rb,
lib/dynamoid_advanced_where/nodes/literal_node.rb,
lib/dynamoid_advanced_where/nodes/equality_node.rb,
lib/dynamoid_advanced_where/nodes/less_than_node.rb,
lib/dynamoid_advanced_where/nodes/operation_node.rb,
lib/dynamoid_advanced_where/nodes/greater_than_node.rb,
lib/dynamoid_advanced_where/nodes/array_literal_node.rb

Defined Under Namespace

Modules: Concerns Classes: AndNode, ArrayLiteralNode, BaseNode, CustomClassAttributeNode, EqualityNode, ExistsNode, FieldNode, GreaterThanNode, InNode, IncludesNode, IntegerArrayAttributeNode, IntegerSetAttributeNode, LessThanNode, LiteralNode, MapAttributeNode, NativeBooleanAttributeNode, NotNode, NullNode, NumberAttributeNode, NumericDateAttributeNode, NumericDatetimeAttributeNode, OperationNode, OrNode, RawAttributeNode, RootNode, StringArrayAttributeNode, StringAttributeNode, StringBooleanAttributeNode, StringSetAttributeNode

Constant Summary collapse

FIELD_MAPPING =
{
  { type: :string } => StringAttributeNode,
  { type: :number } => NumberAttributeNode,
  { type: :integer } => NumberAttributeNode,

  # Boolean Fields
  { type: :boolean, store_as_native_boolean: true } =>
    NativeBooleanAttributeNode,
  { type: :boolean, store_as_native_boolean: false } =>
    StringBooleanAttributeNode,
  { type: :boolean } => NativeBooleanAttributeNode,

  # Datetime fields
  { type: :datetime, store_as_string: true } => nil,
  { type: :datetime, store_as_string: false } => NumericDatetimeAttributeNode,
  { type: :datetime } => NumericDatetimeAttributeNode,

  # Date fields
  { type: :date, store_as_string: true } => nil,
  { type: :date, store_as_string: false } => NumericDateAttributeNode,
  { type: :date } => NumericDateAttributeNode,

  # Set Types
  { type: :set, of: :string } => StringSetAttributeNode,
  { type: :set, of: :integer } => IntegerSetAttributeNode,

  # Array Types
  { type: :array, of: :string } => StringArrayAttributeNode,
  { type: :array, of: :integer } => IntegerArrayAttributeNode,

  # Map Types
  { type: :map } => MapAttributeNode,

  # Raw Types
  { type: :raw } => RawAttributeNode,

  # Custom Object
  ->(c) { c[:type].is_a?(Class) } => CustomClassAttributeNode,
}.freeze