Sha256: 97b491478283cdfc9b52e4c474aaf8e256e825b9e5a14e09e5e57bb435305ef8

Contents?: true

Size: 793 Bytes

Versions: 2

Compression:

Stored size: 793 Bytes

Contents

module AnsibleTowerClient
  class Api < Connection
    attr_reader :instance
    def initialize(connection)
      @instance = connection
    end

    def hosts
      Collection.new(self, Host)
    end

    def groups
      Collection.new(self, Group)
    end

    def inventories
      Collection.new(self, Inventory)
    end

    def job_templates
      Collection.new(self, JobTemplate)
    end

    def ad_hoc_commands
      Collection.new(self, AdHocCommand)
    end

    def jobs
      Collection.new(self, Job)
    end

    def method_missing(method_name, *args, &block)
      instance.respond_to?(method_name) ? instance.send(method_name, *args, &block) : super
    end

    def respond_to_missing?(method, _include_private = false)
      instance.respond_to?(method)
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
ansible_tower_client-0.2.0 lib/ansible_tower_client/api.rb
ansible_tower_client-0.1.0 lib/ansible_tower_client/api.rb