Module: HammerCLIForeman::ResourceSupportedTest
- Included in:
- Location::CreateCommand, Location::DeleteCommand, Location::InfoCommand, Location::ListCommand, Location::UpdateCommand, Organization::CreateCommand, Organization::DeleteCommand, Organization::InfoCommand, Organization::ListCommand, Organization::UpdateCommand
- Defined in:
- lib/hammer_cli_foreman/resource_supported_test.rb
Instance Method Summary collapse
Instance Method Details
#execute ⇒ Object
7 8 9 10 11 12 13 |
# File 'lib/hammer_cli_foreman/resource_supported_test.rb', line 7 def execute if resource_supported? super else raise OperationNotSupportedError, _("The server does not support such operation.") end end |
#resource_supported? ⇒ Boolean
15 16 17 18 19 20 |
# File 'lib/hammer_cli_foreman/resource_supported_test.rb', line 15 def resource_supported? resource.call(:index) true rescue RestClient::ResourceNotFound false end |