Class: OSPFv2::LSDB::AdvertisedRouters
- Defined in:
- lib/ls_db/advertised_routers.rb
Constant Summary collapse
Instance Method Summary collapse
- #-(id) ⇒ Object
- #<<(id) ⇒ Object
- #has?(id) ⇒ Boolean
-
#initialize ⇒ AdvertisedRouters
constructor
A new instance of AdvertisedRouters.
- #routers ⇒ Object (also: #ids)
- #to_s ⇒ Object
Constructor Details
#initialize ⇒ AdvertisedRouters
Returns a new instance of AdvertisedRouters.
29 30 31 |
# File 'lib/ls_db/advertised_routers.rb', line 29 def initialize @set = Set.new end |
Instance Method Details
#-(id) ⇒ Object
45 46 47 |
# File 'lib/ls_db/advertised_routers.rb', line 45 def -(id) @set.delete router_id(id) end |
#<<(id) ⇒ Object
32 33 34 |
# File 'lib/ls_db/advertised_routers.rb', line 32 def <<(id) @set << router_id(id) end |
#has?(id) ⇒ Boolean
39 40 41 |
# File 'lib/ls_db/advertised_routers.rb', line 39 def has?(id) routers.include?(router_id(id)) end |
#routers ⇒ Object Also known as: ids
35 36 37 |
# File 'lib/ls_db/advertised_routers.rb', line 35 def routers @set.collect.sort end |