Class: UState::Client::Query
- Inherits:
-
Object
- Object
- UState::Client::Query
- Defined in:
- lib/ustate/client/query.rb
Instance Method Summary collapse
-
#initialize ⇒ Query
constructor
Little query builder.
- #method_missing(field) ⇒ Object
Constructor Details
#initialize ⇒ Query
Little query builder
4 5 6 |
# File 'lib/ustate/client/query.rb', line 4 def initialize @predicate = nil end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(field) ⇒ Object
8 9 10 11 12 13 14 15 |
# File 'lib/ustate/client/query.rb', line 8 def method_missing(field) field = field.to_sym beefcake_field = UState::Query.fields.find { |f| f.name == field } raise ArgumentError, "no such field #{field.inspect}" unless beefcake_field beefcake_field.type::Proxy end |