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.



1329
1330
1331
# File 'lib/mockserver/models.rb', line 1329

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

Instance Attribute Details

#idObject

Returns the value of attribute id.



1327
1328
1329
# File 'lib/mockserver/models.rb', line 1327

def id
  @id
end

Class Method Details

.from_hash(data) ⇒ Object



1337
1338
1339
1340
1341
# File 'lib/mockserver/models.rb', line 1337

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

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

Instance Method Details

#to_hObject



1333
1334
1335
# File 'lib/mockserver/models.rb', line 1333

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