Class: MockServer::ExpectationId

Inherits:
Object
  • Object
show all
Defined in:
lib/mockserver/models.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id: '') ⇒ ExpectationId

Returns a new instance of ExpectationId.



1015
1016
1017
# File 'lib/mockserver/models.rb', line 1015

def initialize(id: '')
  @id = id
end

Instance Attribute Details

#idObject

Returns the value of attribute id.



1013
1014
1015
# File 'lib/mockserver/models.rb', line 1013

def id
  @id
end

Class Method Details

.from_hash(data) ⇒ Object



1023
1024
1025
1026
1027
# File 'lib/mockserver/models.rb', line 1023

def self.from_hash(data)
  return nil if data.nil?

  new(id: data.fetch('id', ''))
end

Instance Method Details

#to_hObject



1019
1020
1021
# File 'lib/mockserver/models.rb', line 1019

def to_h
  { 'id' => @id }
end