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.
2639 2640 2641 2642 |
# File 'lib/mockserver/models.rb', line 2639 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.
2637 2638 2639 |
# File 'lib/mockserver/models.rb', line 2637 def at_least @at_least end |
#at_most ⇒ Object
Returns the value of attribute at_most.
2637 2638 2639 |
# File 'lib/mockserver/models.rb', line 2637 def at_most @at_most end |
Class Method Details
.at_least(count) ⇒ Object
2660 2661 2662 |
# File 'lib/mockserver/models.rb', line 2660 def self.at_least(count) new(at_least: count) end |
.at_most(count) ⇒ Object
2664 2665 2666 |
# File 'lib/mockserver/models.rb', line 2664 def self.at_most(count) new(at_most: count) end |
.between(at_least, at_most) ⇒ Object
2676 2677 2678 |
# File 'lib/mockserver/models.rb', line 2676 def self.between(at_least, at_most) new(at_least: at_least, at_most: at_most) end |
.exactly(count) ⇒ Object
2668 2669 2670 |
# File 'lib/mockserver/models.rb', line 2668 def self.exactly(count) new(at_least: count, at_most: count) end |
.from_hash(data) ⇒ Object
2651 2652 2653 2654 2655 2656 2657 2658 |
# File 'lib/mockserver/models.rb', line 2651 def self.from_hash(data) return nil if data.nil? new( at_least: data['atLeast'], at_most: data['atMost'] ) end |
.once ⇒ Object
2672 2673 2674 |
# File 'lib/mockserver/models.rb', line 2672 def self.once new(at_least: 1, at_most: 1) end |
Instance Method Details
#to_h ⇒ Object
2644 2645 2646 2647 2648 2649 |
# File 'lib/mockserver/models.rb', line 2644 def to_h MockServer.strip_none({ 'atLeast' => @at_least, 'atMost' => @at_most }) end |