Class: Deli::Param
- Inherits:
-
Object
- Object
- Deli::Param
- Defined in:
- lib/deli/param.rb
Direct Known Subclasses
Adapters::ActiveRecord::Param, Adapters::Cassandra::Param, Adapters::Mongoid::Param, Adapters::Neo4j::Param, Adapters::Simple::Param
Defined Under Namespace
Modules: Date, Geo, Limit, Number, Offset, Order, String, Time
Instance Attribute Summary (collapse)
-
- (Object) controller
Returns the value of attribute controller.
-
- (Object) default
Returns the value of attribute default.
-
- (Object) exact
Returns the value of attribute exact.
-
- (Object) key
Returns the value of attribute key.
-
- (Object) model_name
Returns the value of attribute model_name.
-
- (Object) namespace
Returns the value of attribute namespace.
Instance Method Summary (collapse)
-
- (Param) initialize(key, options = {})
constructor
A new instance of Param.
- - (Object) inspect
- - (Object) parse(value)
- - (Object) parse_value(value, operators)
- - (Object) render(value)
Constructor Details
- (Param) initialize(key, options = {})
A new instance of Param
150 151 152 153 154 155 156 157 |
# File 'lib/deli/param.rb', line 150 def initialize(key, = {}) self.controller = [:controller] self.key = key.to_s self.model_name = [:model_name] self.namespace = self.model_name.to_s.pluralize.to_sym if model_name.present? self.exact = [:exact] || false self.default = [:default] end |
Instance Attribute Details
- (Object) controller
Returns the value of attribute controller
148 149 150 |
# File 'lib/deli/param.rb', line 148 def controller @controller end |
- (Object) default
Returns the value of attribute default
148 149 150 |
# File 'lib/deli/param.rb', line 148 def default @default end |
- (Object) exact
Returns the value of attribute exact
148 149 150 |
# File 'lib/deli/param.rb', line 148 def exact @exact end |
- (Object) key
Returns the value of attribute key
148 149 150 |
# File 'lib/deli/param.rb', line 148 def key @key end |
- (Object) model_name
Returns the value of attribute model_name
148 149 150 |
# File 'lib/deli/param.rb', line 148 def model_name @model_name end |
- (Object) namespace
Returns the value of attribute namespace
148 149 150 |
# File 'lib/deli/param.rb', line 148 def namespace @namespace end |
Instance Method Details
- (Object) inspect
176 177 178 |
# File 'lib/deli/param.rb', line 176 def inspect "#<#{self.class.name} @key=#{key.inspect} @model_name=#{model_name.inspect}>" end |
- (Object) parse(value)
159 160 161 |
# File 'lib/deli/param.rb', line 159 def parse(value) value end |
- (Object) parse_value(value, operators)
167 168 169 170 171 172 173 174 |
# File 'lib/deli/param.rb', line 167 def parse_value(value, operators) { :namespace => namespace, :key => key, :operators => operators, :value => value } end |
- (Object) render(value)
163 164 165 |
# File 'lib/deli/param.rb', line 163 def render(value) value end |