class AgnosticBackend::Queryable::Value

Attributes

parent[R]
value[RW]

Public Class Methods

new(value, parent:, context:) click to toggle source
# File lib/agnostic_backend/queryable/value.rb, line 8
def initialize(value, parent:, context:)
  super([], context)
  @value, @parent = value, parent
end

Public Instance Methods

==(o) click to toggle source
Calls superclass method AgnosticBackend::Queryable::TreeNode#==
# File lib/agnostic_backend/queryable/value.rb, line 13
def ==(o)
  super && o.value == value
end
associated_attribute() click to toggle source
# File lib/agnostic_backend/queryable/value.rb, line 17
def associated_attribute
  parent.attribute if parent.respond_to? :attribute
end
type() click to toggle source
# File lib/agnostic_backend/queryable/value.rb, line 21
def type
  return :text if associated_attribute.try(:any?)
  associated_attribute.type if associated_attribute.present?
end