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.
2751 2752 2753 |
# File 'lib/mockserver/models.rb', line 2751 def initialize(ports: []) @ports = ports end |
Instance Attribute Details
#ports ⇒ Object
Returns the value of attribute ports.
2749 2750 2751 |
# File 'lib/mockserver/models.rb', line 2749 def ports @ports end |
Class Method Details
.from_hash(data) ⇒ Object
2759 2760 2761 2762 2763 |
# File 'lib/mockserver/models.rb', line 2759 def self.from_hash(data) return nil if data.nil? new(ports: data.fetch('ports', [])) end |
Instance Method Details
#to_h ⇒ Object
2755 2756 2757 |
# File 'lib/mockserver/models.rb', line 2755 def to_h { 'ports' => @ports } end |