Class: MockServer::ExpectationId
- Inherits:
-
Object
- Object
- MockServer::ExpectationId
- Defined in:
- lib/mockserver/models.rb
Instance Attribute Summary collapse
-
#id ⇒ Object
Returns the value of attribute id.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(id: '') ⇒ ExpectationId
constructor
A new instance of ExpectationId.
- #to_h ⇒ Object
Constructor Details
#initialize(id: '') ⇒ ExpectationId
Returns a new instance of ExpectationId.
995 996 997 |
# File 'lib/mockserver/models.rb', line 995 def initialize(id: '') @id = id end |
Instance Attribute Details
#id ⇒ Object
Returns the value of attribute id.
993 994 995 |
# File 'lib/mockserver/models.rb', line 993 def id @id end |
Class Method Details
.from_hash(data) ⇒ Object
1003 1004 1005 1006 1007 |
# File 'lib/mockserver/models.rb', line 1003 def self.from_hash(data) return nil if data.nil? new(id: data.fetch('id', '')) end |
Instance Method Details
#to_h ⇒ Object
999 1000 1001 |
# File 'lib/mockserver/models.rb', line 999 def to_h { 'id' => @id } end |