Class: Libsql::PositionalArgBuilder
- Inherits:
-
Object
- Object
- Libsql::PositionalArgBuilder
- Defined in:
- lib/libsql.rb
Instance Attribute Summary collapse
-
#args ⇒ Object
readonly
Returns the value of attribute args.
Instance Method Summary collapse
- #build ⇒ Object
- #empty? ⇒ Boolean
-
#initialize(*args) ⇒ PositionalArgBuilder
constructor
A new instance of PositionalArgBuilder.
- #key ⇒ Object
Constructor Details
#initialize(*args) ⇒ PositionalArgBuilder
Returns a new instance of PositionalArgBuilder.
75 76 77 |
# File 'lib/libsql.rb', line 75 def initialize(*args) @args = args end |
Instance Attribute Details
#args ⇒ Object (readonly)
Returns the value of attribute args.
73 74 75 |
# File 'lib/libsql.rb', line 73 def args @args end |
Instance Method Details
#build ⇒ Object
83 84 85 86 87 88 89 90 91 92 93 94 95 96 |
# File 'lib/libsql.rb', line 83 def build args.reduce([]) do |acc, value| type = case value in Integer "integer" in NilClass "null" else "text" end acc << { type:, value: } end end |
#empty? ⇒ Boolean
79 |
# File 'lib/libsql.rb', line 79 def empty? = @args.empty? |
#key ⇒ Object
81 |
# File 'lib/libsql.rb', line 81 def key = :args |