Class: AnsibleTowerClient::InventorySource

Inherits:
BaseModel show all
Defined in:
lib/ansible_tower_client/base_models/inventory_source.rb

Instance Attribute Summary

Attributes inherited from BaseModel

#api, #raw_hash

Instance Method Summary collapse

Methods inherited from BaseModel

base_class, create, create!, #destroy, #destroy!, endpoint, #hashify, #initialize, #override_raw_attributes, #save, #save!, #update_attributes, #update_attributes!

Methods inherited from HashModel

#==, #[], #initialize, #inspect, #to_h, #to_json

Constructor Details

This class inherits a constructor from AnsibleTowerClient::BaseModel

Instance Method Details

#can_update?Boolean

Returns:

  • (Boolean)


3
4
5
6
7
8
# File 'lib/ansible_tower_client/base_models/inventory_source.rb', line 3

def can_update?
  response = api.get(related['update'].to_s).body

  updatable = JSON.parse(response)
  updatable['can_update']
end

#updateObject



10
11
12
13
14
15
# File 'lib/ansible_tower_client/base_models/inventory_source.rb', line 10

def update
  response = api.post(related['update'].to_s).body

  update = JSON.parse(response)
  api.inventory_updates.find(update['inventory_update'])
end