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.
2244 2245 2246 |
# File 'lib/mockserver/models.rb', line 2244 def initialize(ports: []) @ports = ports end |
Instance Attribute Details
#ports ⇒ Object
Returns the value of attribute ports.
2242 2243 2244 |
# File 'lib/mockserver/models.rb', line 2242 def ports @ports end |
Class Method Details
.from_hash(data) ⇒ Object
2252 2253 2254 2255 2256 |
# File 'lib/mockserver/models.rb', line 2252 def self.from_hash(data) return nil if data.nil? new(ports: data.fetch('ports', [])) end |
Instance Method Details
#to_h ⇒ Object
2248 2249 2250 |
# File 'lib/mockserver/models.rb', line 2248 def to_h { 'ports' => @ports } end |