Class: AlgebraDB::Value

Inherits:
Struct
  • Object
show all
Extended by:
Operations::Definition
Defined in:
lib/algebra_db/value.rb,
lib/algebra_db/value/bool.rb,
lib/algebra_db/value/text.rb,
lib/algebra_db/value/array.rb,
lib/algebra_db/value/jsonb.rb,
lib/algebra_db/value/double.rb,
lib/algebra_db/value/integer.rb,
lib/algebra_db/value/operations.rb,
lib/algebra_db/value/operations/numeric.rb,
lib/algebra_db/value/operations/definition.rb

Overview

Base class for value types in the DB.

Direct Known Subclasses

Array, Bool, Double, Integer, JSONB, Text

Defined Under Namespace

Modules: Operations Classes: Array, Bool, Double, Integer, JSONB, Text

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Operations::Definition

binop

Instance Attribute Details

#builderObject

Returns the value of attribute builder

Returns:

  • (Object)

    the current value of builder



4
5
6
# File 'lib/algebra_db/value.rb', line 4

def builder
  @builder
end

Instance Method Details

#decoderObject



27
28
29
# File 'lib/algebra_db/value.rb', line 27

def decoder
  Exec::Decoder.new
end

#render_syntax(syntax_builder) ⇒ Object



15
16
17
# File 'lib/algebra_db/value.rb', line 15

def render_syntax(syntax_builder)
  builder.render_syntax(syntax_builder)
end

#to_select_itemObject



19
20
21
22
23
24
25
# File 'lib/algebra_db/value.rb', line 19

def to_select_item
  unless builder.respond_to?(:default_select_item_alias)
    raise ArgumentError, "#{builder.inspect} has no default alias for us as a select item"
  end

  Build::SelectItem.new(self, builder.default_select_item_alias)
end