Class: TFS::Queryable
- Inherits:
-
Object
- Object
- TFS::Queryable
- Extended by:
- ClassHelpers
- Defined in:
- lib/tfs/queryable.rb
Direct Known Subclasses
Constant Summary
Constants included from ClassHelpers
Class Method Summary collapse
-
.all ⇒ Object
Always limit to the default limit of 50 so as not to overwhelm the service If more are required, set ‘#limit` explicitly.
- .inherited(klass) ⇒ Object
-
.odata_query(raw_query) ⇒ Object
(also: where)
#odata_query allows you to access the raw query sytax provide by the OData api.
Methods included from ClassHelpers
base_class, method_name_from_class, odata_class_from_method_name
Class Method Details
.all ⇒ Object
Always limit to the default limit of 50 so as not to overwhelm the service If more are required, set ‘#limit` explicitly.
7 8 9 |
# File 'lib/tfs/queryable.rb', line 7 def all get_query.limit(QueryEngine::DEFAULT_LIMIT).run end |
.inherited(klass) ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/tfs/queryable.rb', line 11 def inherited(klass) klass.instance_eval do @children = [] def add_child(child_class) base = method_name_from_class(child_class).to_sym self.send(:define_singleton_method, "#{base}?") { true } end end end |