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.
2132 2133 2134 2135 |
# File 'lib/mockserver/models.rb', line 2132 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.
2130 2131 2132 |
# File 'lib/mockserver/models.rb', line 2130 def at_least @at_least end |
#at_most ⇒ Object
Returns the value of attribute at_most.
2130 2131 2132 |
# File 'lib/mockserver/models.rb', line 2130 def at_most @at_most end |
Class Method Details
.at_least(count) ⇒ Object
2153 2154 2155 |
# File 'lib/mockserver/models.rb', line 2153 def self.at_least(count) new(at_least: count) end |
.at_most(count) ⇒ Object
2157 2158 2159 |
# File 'lib/mockserver/models.rb', line 2157 def self.at_most(count) new(at_most: count) end |
.between(at_least, at_most) ⇒ Object
2169 2170 2171 |
# File 'lib/mockserver/models.rb', line 2169 def self.between(at_least, at_most) new(at_least: at_least, at_most: at_most) end |
.exactly(count) ⇒ Object
2161 2162 2163 |
# File 'lib/mockserver/models.rb', line 2161 def self.exactly(count) new(at_least: count, at_most: count) end |
.from_hash(data) ⇒ Object
2144 2145 2146 2147 2148 2149 2150 2151 |
# File 'lib/mockserver/models.rb', line 2144 def self.from_hash(data) return nil if data.nil? new( at_least: data['atLeast'], at_most: data['atMost'] ) end |
.once ⇒ Object
2165 2166 2167 |
# File 'lib/mockserver/models.rb', line 2165 def self.once new(at_least: 1, at_most: 1) end |
Instance Method Details
#to_h ⇒ Object
2137 2138 2139 2140 2141 2142 |
# File 'lib/mockserver/models.rb', line 2137 def to_h MockServer.strip_none({ 'atLeast' => @at_least, 'atMost' => @at_most }) end |