Class: MockServer::VerificationTimes
- Inherits:
-
Object
- Object
- MockServer::VerificationTimes
- Defined in:
- lib/mockserver/models.rb
Instance Attribute Summary collapse
-
#at_least ⇒ Object
Returns the value of attribute at_least.
-
#at_most ⇒ Object
Returns the value of attribute at_most.
Class Method Summary collapse
- .at_least(count) ⇒ Object
- .at_most(count) ⇒ Object
- .between(at_least, at_most) ⇒ Object
- .exactly(count) ⇒ Object
- .from_hash(data) ⇒ Object
- .once ⇒ Object
Instance Method Summary collapse
-
#initialize(at_least: nil, at_most: nil) ⇒ VerificationTimes
constructor
A new instance of VerificationTimes.
- #to_h ⇒ Object
Constructor Details
#initialize(at_least: nil, at_most: nil) ⇒ VerificationTimes
Returns a new instance of VerificationTimes.
1354 1355 1356 1357 |
# File 'lib/mockserver/models.rb', line 1354 def initialize(at_least: nil, at_most: nil) @at_least = at_least @at_most = at_most end |
Instance Attribute Details
#at_least ⇒ Object
Returns the value of attribute at_least.
1352 1353 1354 |
# File 'lib/mockserver/models.rb', line 1352 def at_least @at_least end |
#at_most ⇒ Object
Returns the value of attribute at_most.
1352 1353 1354 |
# File 'lib/mockserver/models.rb', line 1352 def at_most @at_most end |
Class Method Details
.at_least(count) ⇒ Object
1375 1376 1377 |
# File 'lib/mockserver/models.rb', line 1375 def self.at_least(count) new(at_least: count) end |
.at_most(count) ⇒ Object
1379 1380 1381 |
# File 'lib/mockserver/models.rb', line 1379 def self.at_most(count) new(at_most: count) end |
.between(at_least, at_most) ⇒ Object
1391 1392 1393 |
# File 'lib/mockserver/models.rb', line 1391 def self.between(at_least, at_most) new(at_least: at_least, at_most: at_most) end |
.exactly(count) ⇒ Object
1383 1384 1385 |
# File 'lib/mockserver/models.rb', line 1383 def self.exactly(count) new(at_least: count, at_most: count) end |
.from_hash(data) ⇒ Object
1366 1367 1368 1369 1370 1371 1372 1373 |
# File 'lib/mockserver/models.rb', line 1366 def self.from_hash(data) return nil if data.nil? new( at_least: data['atLeast'], at_most: data['atMost'] ) end |
.once ⇒ Object
1387 1388 1389 |
# File 'lib/mockserver/models.rb', line 1387 def self.once new(at_least: 1, at_most: 1) end |
Instance Method Details
#to_h ⇒ Object
1359 1360 1361 1362 1363 1364 |
# File 'lib/mockserver/models.rb', line 1359 def to_h MockServer.strip_none({ 'atLeast' => @at_least, 'atMost' => @at_most }) end |