module Atomsphere

@author Warren Guy

Constants

ROOT
VERSION

Attributes

configuration[RW]

Public Class Methods

configure() { |configuration| ... } click to toggle source
# File lib/atomsphere/configuration.rb, line 18
def self.configure
  self.configuration ||= Configuration.new
  yield configuration

  configuration
end
query(object_type=nil, &block) click to toggle source

Invoke the DSL for constructing an {Atomsphere::Query}

@example without an expression, returns all possible results

Atomsphere.query(:process)

@example a simple query expression for online Atoms

Atomsphere.query(:atom) { status.equals :online }

@example a query expression for online cloud Atoms (implied `and` group)

Atomsphere.query(:atom) do
  status.equals :online
  type.equals :cloud
end

@example a more complex example with nested group expressions

Atomsphere.query(:atom) do
  group :or do
    date_installed.less_than '2018-12-01T00:00:00Z'
    group :and do
      status.not_equals :online
      type.not_equals :cloud
    end
  end
end
# File lib/atomsphere/query/builder.rb, line 64
def self.query(object_type=nil, &block)
  q = Query::Builder.new(object_type)
  q.instance_eval(&block) if block_given?

  q.query
end