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.
2010 2011 2012 |
# File 'lib/mockserver/models.rb', line 2010 def initialize(ports: []) @ports = ports end |
Instance Attribute Details
#ports ⇒ Object
Returns the value of attribute ports.
2008 2009 2010 |
# File 'lib/mockserver/models.rb', line 2008 def ports @ports end |
Class Method Details
.from_hash(data) ⇒ Object
2018 2019 2020 2021 2022 |
# File 'lib/mockserver/models.rb', line 2018 def self.from_hash(data) return nil if data.nil? new(ports: data.fetch('ports', [])) end |
Instance Method Details
#to_h ⇒ Object
2014 2015 2016 |
# File 'lib/mockserver/models.rb', line 2014 def to_h { 'ports' => @ports } end |