Class: Mt::Wall::Model::Group
- Inherits:
-
Data
- Object
- Data
- Mt::Wall::Model::Group
- Defined in:
- lib/mt/wall/model/group.rb
Overview
A named collection of AddressObjects and/or other Groups.
RouterOS address-lists are NOT nestable, so groups have no native equivalent: the Compiler FLATTENS a group into the union of its members’ addresses (recursively expanding nested groups). This flattening is the central responsibility of the Compiler.
NOTE: the ‘:members` Data member intentionally shadows Data#members (the auto-generated list of member NAMES). Renaming would break the domain-meaningful public API (`group.members` = the group’s contents), so the Lint/DataDefineOverride warning is suppressed here on purpose.
Instance Attribute Summary collapse
-
#comment ⇒ Object
readonly
Returns the value of attribute comment.
-
#members ⇒ Object
readonly
Returns the value of attribute members.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(name:, members: [], comment: nil) ⇒ Group
constructor
A new instance of Group.
Constructor Details
#initialize(name:, members: [], comment: nil) ⇒ Group
Returns a new instance of Group.
21 22 23 |
# File 'lib/mt/wall/model/group.rb', line 21 def initialize(name:, members: [], comment: nil) super(name: name, members: Array(members), comment: comment) end |
Instance Attribute Details
#comment ⇒ Object (readonly)
Returns the value of attribute comment
20 21 22 23 24 |
# File 'lib/mt/wall/model/group.rb', line 20 Group = Data.define(:name, :members, :comment) do # rubocop:disable Lint/DataDefineOverride def initialize(name:, members: [], comment: nil) super(name: name, members: Array(members), comment: comment) end end |
#members ⇒ Object (readonly)
Returns the value of attribute members
20 21 22 23 24 |
# File 'lib/mt/wall/model/group.rb', line 20 Group = Data.define(:name, :members, :comment) do # rubocop:disable Lint/DataDefineOverride def initialize(name:, members: [], comment: nil) super(name: name, members: Array(members), comment: comment) end end |
#name ⇒ Object (readonly)
Returns the value of attribute name
20 21 22 23 24 |
# File 'lib/mt/wall/model/group.rb', line 20 Group = Data.define(:name, :members, :comment) do # rubocop:disable Lint/DataDefineOverride def initialize(name:, members: [], comment: nil) super(name: name, members: Array(members), comment: comment) end end |