Class: Megam::Mixins::Policies
- Inherits:
-
Object
- Object
- Megam::Mixins::Policies
- Defined in:
- lib/megam/mixins/policies.rb
Instance Attribute Summary collapse
-
#bind_type ⇒ Object
readonly
Returns the value of attribute bind_type.
-
#policymembers ⇒ Object
readonly
Returns the value of attribute policymembers.
Instance Method Summary collapse
-
#initialize(params) ⇒ Policies
constructor
A new instance of Policies.
- #to_array ⇒ Object
Constructor Details
#initialize(params) ⇒ Policies
Returns a new instance of Policies.
6 7 8 9 |
# File 'lib/megam/mixins/policies.rb', line 6 def initialize(params) @bind_type = params[:bind_type] if params.key?(:bind_type) @policymembers = params[:policymembers] if params.key?(:policymembers) end |
Instance Attribute Details
#bind_type ⇒ Object (readonly)
Returns the value of attribute bind_type.
4 5 6 |
# File 'lib/megam/mixins/policies.rb', line 4 def bind_type @bind_type end |
#policymembers ⇒ Object (readonly)
Returns the value of attribute policymembers.
4 5 6 |
# File 'lib/megam/mixins/policies.rb', line 4 def policymembers @policymembers end |
Instance Method Details
#to_array ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/megam/mixins/policies.rb', line 11 def to_array com = [] if @bind_type && @bind_type != 'Unbound service' value = { name: 'bind policy', ptype: 'colocated', members: [ @policymembers ] } com << value end com end |