Class: MockServer::Ports
- Inherits:
-
Object
- Object
- MockServer::Ports
- Defined in:
- lib/mockserver/models.rb
Instance Attribute Summary collapse
-
#ports ⇒ Object
Returns the value of attribute ports.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(ports: []) ⇒ Ports
constructor
A new instance of Ports.
- #to_h ⇒ Object
Constructor Details
#initialize(ports: []) ⇒ Ports
Returns a new instance of Ports.
1459 1460 1461 |
# File 'lib/mockserver/models.rb', line 1459 def initialize(ports: []) @ports = ports end |
Instance Attribute Details
#ports ⇒ Object
Returns the value of attribute ports.
1457 1458 1459 |
# File 'lib/mockserver/models.rb', line 1457 def ports @ports end |
Class Method Details
.from_hash(data) ⇒ Object
1467 1468 1469 1470 1471 |
# File 'lib/mockserver/models.rb', line 1467 def self.from_hash(data) return nil if data.nil? new(ports: data.fetch('ports', [])) end |
Instance Method Details
#to_h ⇒ Object
1463 1464 1465 |
# File 'lib/mockserver/models.rb', line 1463 def to_h { 'ports' => @ports } end |