Sha256: f4bd34f9ea5958ab152c5f8ad12a21d6279b22ec5031077c9517962b5a76d687

Contents?: true

Size: 391 Bytes

Versions: 8

Compression:

Stored size: 391 Bytes

Contents

module UState
  class Client::Query
    # Little query builder
    def initialize
      @predicate = nil
    end

    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
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
ustate-client-0.0.8 lib/ustate/client/query.rb
ustate-client-0.0.7 lib/ustate/client/query.rb
ustate-client-0.0.6 lib/ustate/client/query.rb
ustate-client-0.0.5 lib/ustate/client/query.rb
ustate-client-0.0.4 lib/ustate/client/query.rb
ustate-client-0.0.3 lib/ustate/client/query.rb
ustate-client-0.0.2 lib/ustate/client/query.rb
ustate-client-0.0.1 lib/ustate/client/query.rb