class TheBigDB::StatementRequest
Beautified builder
Attributes
action[R]
params[R]
Public Class Methods
new(action)
click to toggle source
# File lib/thebigdb/resources/statement.rb, line 16 def initialize(action) @action = action @params = {} @response = nil end
Public Instance Methods
inspect()
click to toggle source
# File lib/thebigdb/resources/statement.rb, line 45 def inspect load.inspect end
load()
click to toggle source
# File lib/thebigdb/resources/statement.rb, line 33 def load to_hash # goes through method_missing end
load!()
click to toggle source
# File lib/thebigdb/resources/statement.rb, line 39 def load! # forces the request to be re-loadd @response = nil to_hash end
Also aliased as: execute!
method_missing(method_name, *arguments, &block)
click to toggle source
# File lib/thebigdb/resources/statement.rb, line 28 def method_missing(method_name, *arguments, &block) @response ||= TheBigDB::Statement(@action, @params).response @response.send(method_name, *arguments, &block) end
with(params = {})
click to toggle source
# File lib/thebigdb/resources/statement.rb, line 22 def with(params = {}) @response = nil @params.merge!(TheBigDB::Helpers::stringify_keys(params)) self end