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.



1107
1108
1109
# File 'lib/mockserver/models.rb', line 1107

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

Instance Attribute Details

#idObject

Returns the value of attribute id.



1105
1106
1107
# File 'lib/mockserver/models.rb', line 1105

def id
  @id
end

Class Method Details

.from_hash(data) ⇒ Object



1115
1116
1117
1118
1119
# File 'lib/mockserver/models.rb', line 1115

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

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

Instance Method Details

#to_hObject



1111
1112
1113
# File 'lib/mockserver/models.rb', line 1111

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