Class: Dox::DSL::ResourceGroup
- Inherits:
-
Object
- Object
- Dox::DSL::ResourceGroup
- Includes:
- AttrProxy
- Defined in:
- lib/dox/dsl/resource_group.rb
Instance Attribute Summary collapse
-
#desc ⇒ Object
writeonly
Sets the attribute desc.
-
#name ⇒ Object
writeonly
Sets the attribute name.
Instance Method Summary collapse
- #config ⇒ Object
-
#initialize(name, &block) ⇒ ResourceGroup
constructor
A new instance of ResourceGroup.
Methods included from AttrProxy
Constructor Details
#initialize(name, &block) ⇒ ResourceGroup
Returns a new instance of ResourceGroup.
9 10 11 12 13 14 |
# File 'lib/dox/dsl/resource_group.rb', line 9 def initialize(name, &block) self.name = name instance_eval(&block) if block_given? raise(Dox::Errors::InvalidResourceGroupError, 'Resource group name is required!') if @name.blank? end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Dox::DSL::AttrProxy
Instance Attribute Details
#desc=(value) ⇒ Object (writeonly)
Sets the attribute desc
7 8 9 |
# File 'lib/dox/dsl/resource_group.rb', line 7 def desc=(value) @desc = value end |
#name=(value) ⇒ Object (writeonly)
Sets the attribute name
6 7 8 |
# File 'lib/dox/dsl/resource_group.rb', line 6 def name=(value) @name = value end |
Instance Method Details
#config ⇒ Object
16 17 18 19 20 21 22 |
# File 'lib/dox/dsl/resource_group.rb', line 16 def config { resource_group_name: @name.presence, resource_group_desc: @desc.presence, apidoc: true } end |