Sha256: eee5462987a74cb432c45cb34845b5a927e869d2e6a176dc2be7140361fe83ed

Contents?: true

Size: 951 Bytes

Versions: 2

Compression:

Stored size: 951 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 inventory_sources
      Collection.new(self, InventorySource)
    end

    def inventory_updates
      Collection.new(self, InventoryUpdate)
    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.3.1 lib/ansible_tower_client/api.rb
ansible_tower_client-0.3.0 lib/ansible_tower_client/api.rb