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.
1975 1976 1977 |
# File 'lib/mockserver/models.rb', line 1975 def initialize(ports: []) @ports = ports end |
Instance Attribute Details
#ports ⇒ Object
Returns the value of attribute ports.
1973 1974 1975 |
# File 'lib/mockserver/models.rb', line 1973 def ports @ports end |
Class Method Details
.from_hash(data) ⇒ Object
1983 1984 1985 1986 1987 |
# File 'lib/mockserver/models.rb', line 1983 def self.from_hash(data) return nil if data.nil? new(ports: data.fetch('ports', [])) end |
Instance Method Details
#to_h ⇒ Object
1979 1980 1981 |
# File 'lib/mockserver/models.rb', line 1979 def to_h { 'ports' => @ports } end |