Class: Traffic
- Inherits:
-
Object
- Object
- Traffic
- Defined in:
- lib/ec2/traffic.rb
Instance Attribute Summary collapse
-
#from ⇒ Object
Returns the value of attribute from.
-
#ingress ⇒ Object
Returns the value of attribute ingress.
-
#port_range ⇒ Object
Returns the value of attribute port_range.
-
#to ⇒ Object
Returns the value of attribute to.
Class Method Summary collapse
Instance Method Summary collapse
- #copy(from, to) ⇒ Object
- #eql?(other) ⇒ Boolean
- #hash ⇒ Object
-
#initialize(ingress, from, to, port_range) ⇒ Traffic
constructor
A new instance of Traffic.
Constructor Details
#initialize(ingress, from, to, port_range) ⇒ Traffic
Returns a new instance of Traffic.
4 5 6 7 8 9 |
# File 'lib/ec2/traffic.rb', line 4 def initialize(ingress, from, to, port_range) @ingress = ingress @from = from @to = to @port_range = port_range end |
Instance Attribute Details
#from ⇒ Object
Returns the value of attribute from.
2 3 4 |
# File 'lib/ec2/traffic.rb', line 2 def from @from end |
#ingress ⇒ Object
Returns the value of attribute ingress.
2 3 4 |
# File 'lib/ec2/traffic.rb', line 2 def ingress @ingress end |
#port_range ⇒ Object
Returns the value of attribute port_range.
2 3 4 |
# File 'lib/ec2/traffic.rb', line 2 def port_range @port_range end |
#to ⇒ Object
Returns the value of attribute to.
2 3 4 |
# File 'lib/ec2/traffic.rb', line 2 def to @to end |
Class Method Details
Instance Method Details
#copy(from, to) ⇒ Object
11 12 13 |
# File 'lib/ec2/traffic.rb', line 11 def copy(from, to) Traffic.new(@ingress, from, to, @port_range) end |
#eql?(other) ⇒ Boolean
15 16 17 18 19 20 21 |
# File 'lib/ec2/traffic.rb', line 15 def eql?(other) if @ingress == other.ingress @from == other.from && @to == other.to && @port_range == other.port_range else @from == other.to && @to == other.from && @port_range == other.port_range end end |
#hash ⇒ Object
23 24 25 |
# File 'lib/ec2/traffic.rb', line 23 def hash @from.hash + @to.hash + @port_range.hash end |