class TFS::Queryable

Constants

RecordNotFound

Public Class Methods

add_child(child_class) click to toggle source
# File lib/tfs/queryable.rb, line 17
def add_child(child_class)

  base = method_name_from_class(child_class).to_sym
  self.send(:define_singleton_method, "#{base}?") { true }
end
all() click to toggle source

Always limit to the default limit of 50 so as not to overwhelm the service If more are required, set ‘#limit` explicitly.

# File lib/tfs/queryable.rb, line 9
def all
  get_query.limit(QueryEngine::DEFAULT_LIMIT).run
end
inherited(klass) click to toggle source
# File lib/tfs/queryable.rb, line 13
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
odata_query(raw_query) click to toggle source

odata_query allows you to access the raw query sytax provide by the OData api

TFS::Builds.odata_query('Status eq "Succeeded"')
# File lib/tfs/queryable.rb, line 29
def odata_query(raw_query)
  get_query.where(raw_query)
end
Also aliased as: where
where(raw_query)
Alias for: odata_query

Private Class Methods

get_query() click to toggle source
# File lib/tfs/queryable.rb, line 35
def get_query
  TFS.send(method_name_from_class)
end