Class: Vra::CatalogBase
- Inherits:
-
Object
- Object
- Vra::CatalogBase
- Defined in:
- lib/vra/catalog_base.rb
Overview
Base class with common methods
Direct Known Subclasses
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Returns the value of attribute id.
Instance Method Summary collapse
- #entitle!(opts = {}) ⇒ Object
-
#initialize(client, opts) ⇒ CatalogBase
constructor
Either one of id or data hash is required, must not supply both.
Constructor Details
#initialize(client, opts) ⇒ CatalogBase
Either one of id or data hash is required, must not supply both
27 28 29 30 31 |
# File 'lib/vra/catalog_base.rb', line 27 def initialize(client, opts) @client = client @id = opts[:id] @data = opts[:data] end |
Instance Attribute Details
#id ⇒ Object (readonly)
Returns the value of attribute id.
22 23 24 |
# File 'lib/vra/catalog_base.rb', line 22 def id @id end |
Instance Method Details
#entitle!(opts = {}) ⇒ Object
33 34 35 36 37 38 39 40 41 |
# File 'lib/vra/catalog_base.rb', line 33 def entitle!(opts = {}) response = client.http_post( "/catalog/api/admin/entitlements?project_id=#{project_id}", FFI_Yajl::Encoder.encode(entitle_params(opts[:type])), opts[:skip_auth] || false ) FFI_Yajl::Parser.parse(response.body) end |