Class: Influxdb::Arel::Quoter::Repository
- Defined in:
- lib/influxdb/arel/quoter.rb
Instance Method Summary collapse
- #add(type, &block) ⇒ Object
-
#initialize ⇒ Repository
constructor
A new instance of Repository.
- #quote(value) ⇒ Object
Constructor Details
#initialize ⇒ Repository
Returns a new instance of Repository.
9 10 11 |
# File 'lib/influxdb/arel/quoter.rb', line 9 def initialize @types = {} end |
Instance Method Details
#add(type, &block) ⇒ Object
13 14 15 |
# File 'lib/influxdb/arel/quoter.rb', line 13 def add(type, &block) @types[type] = block end |
#quote(value) ⇒ Object
17 18 19 20 |
# File 'lib/influxdb/arel/quoter.rb', line 17 def quote(value) block = @types[value.class] block ? block.call(value) : value.inspect end |