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
-
#controller ⇒ Object
Returns the value of attribute controller.
-
#default ⇒ Object
Returns the value of attribute default.
-
#exact ⇒ Object
Returns the value of attribute exact.
-
#key ⇒ Object
Returns the value of attribute key.
-
#model_name ⇒ Object
Returns the value of attribute model_name.
-
#namespace ⇒ Object
Returns the value of attribute namespace.
Instance Method Summary collapse
-
#initialize(key, options = {}) ⇒ Param
constructor
A new instance of Param.
- #inspect ⇒ Object
- #parse(value) ⇒ Object
- #parse_value(value, operators) ⇒ Object
- #render(value) ⇒ Object
Constructor Details
#initialize(key, options = {}) ⇒ Param
Returns 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
#controller ⇒ Object
Returns the value of attribute controller.
148 149 150 |
# File 'lib/deli/param.rb', line 148 def controller @controller end |
#default ⇒ Object
Returns the value of attribute default.
148 149 150 |
# File 'lib/deli/param.rb', line 148 def default @default end |
#exact ⇒ Object
Returns the value of attribute exact.
148 149 150 |
# File 'lib/deli/param.rb', line 148 def exact @exact end |
#key ⇒ Object
Returns the value of attribute key.
148 149 150 |
# File 'lib/deli/param.rb', line 148 def key @key end |
#model_name ⇒ Object
Returns the value of attribute model_name.
148 149 150 |
# File 'lib/deli/param.rb', line 148 def model_name @model_name end |
#namespace ⇒ Object
Returns the value of attribute namespace.
148 149 150 |
# File 'lib/deli/param.rb', line 148 def namespace @namespace end |
Instance Method Details
#inspect ⇒ Object
176 177 178 |
# File 'lib/deli/param.rb', line 176 def inspect "#<#{self.class.name} @key=#{key.inspect} @model_name=#{model_name.inspect}>" end |
#parse(value) ⇒ Object
159 160 161 |
# File 'lib/deli/param.rb', line 159 def parse(value) value end |
#parse_value(value, operators) ⇒ Object
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 |
#render(value) ⇒ Object
163 164 165 |
# File 'lib/deli/param.rb', line 163 def render(value) value end |