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.



1043
1044
1045
# File 'lib/mockserver/models.rb', line 1043

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

Instance Attribute Details

#idObject

Returns the value of attribute id.



1041
1042
1043
# File 'lib/mockserver/models.rb', line 1041

def id
  @id
end

Class Method Details

.from_hash(data) ⇒ Object



1051
1052
1053
1054
1055
# File 'lib/mockserver/models.rb', line 1051

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

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

Instance Method Details

#to_hObject



1047
1048
1049
# File 'lib/mockserver/models.rb', line 1047

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