Class: MockServer::VerificationTimes

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(at_least: nil, at_most: nil) ⇒ VerificationTimes

Returns a new instance of VerificationTimes.



1898
1899
1900
1901
# File 'lib/mockserver/models.rb', line 1898

def initialize(at_least: nil, at_most: nil)
  @at_least = at_least
  @at_most = at_most
end

Instance Attribute Details

#at_leastObject

Returns the value of attribute at_least.



1896
1897
1898
# File 'lib/mockserver/models.rb', line 1896

def at_least
  @at_least
end

#at_mostObject

Returns the value of attribute at_most.



1896
1897
1898
# File 'lib/mockserver/models.rb', line 1896

def at_most
  @at_most
end

Class Method Details

.at_least(count) ⇒ Object



1919
1920
1921
# File 'lib/mockserver/models.rb', line 1919

def self.at_least(count)
  new(at_least: count)
end

.at_most(count) ⇒ Object



1923
1924
1925
# File 'lib/mockserver/models.rb', line 1923

def self.at_most(count)
  new(at_most: count)
end

.between(at_least, at_most) ⇒ Object



1935
1936
1937
# File 'lib/mockserver/models.rb', line 1935

def self.between(at_least, at_most)
  new(at_least: at_least, at_most: at_most)
end

.exactly(count) ⇒ Object



1927
1928
1929
# File 'lib/mockserver/models.rb', line 1927

def self.exactly(count)
  new(at_least: count, at_most: count)
end

.from_hash(data) ⇒ Object



1910
1911
1912
1913
1914
1915
1916
1917
# File 'lib/mockserver/models.rb', line 1910

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

  new(
    at_least: data['atLeast'],
    at_most:  data['atMost']
  )
end

.onceObject



1931
1932
1933
# File 'lib/mockserver/models.rb', line 1931

def self.once
  new(at_least: 1, at_most: 1)
end

Instance Method Details

#to_hObject



1903
1904
1905
1906
1907
1908
# File 'lib/mockserver/models.rb', line 1903

def to_h
  MockServer.strip_none({
    'atLeast' => @at_least,
    'atMost'  => @at_most
  })
end