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.
1870 1871 1872 1873 |
# File 'lib/mockserver/models.rb', line 1870 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.
1868 1869 1870 |
# File 'lib/mockserver/models.rb', line 1868 def at_least @at_least end |
#at_most ⇒ Object
Returns the value of attribute at_most.
1868 1869 1870 |
# File 'lib/mockserver/models.rb', line 1868 def at_most @at_most end |
Class Method Details
.at_least(count) ⇒ Object
1891 1892 1893 |
# File 'lib/mockserver/models.rb', line 1891 def self.at_least(count) new(at_least: count) end |
.at_most(count) ⇒ Object
1895 1896 1897 |
# File 'lib/mockserver/models.rb', line 1895 def self.at_most(count) new(at_most: count) end |
.between(at_least, at_most) ⇒ Object
1907 1908 1909 |
# File 'lib/mockserver/models.rb', line 1907 def self.between(at_least, at_most) new(at_least: at_least, at_most: at_most) end |
.exactly(count) ⇒ Object
1899 1900 1901 |
# File 'lib/mockserver/models.rb', line 1899 def self.exactly(count) new(at_least: count, at_most: count) end |
.from_hash(data) ⇒ Object
1882 1883 1884 1885 1886 1887 1888 1889 |
# File 'lib/mockserver/models.rb', line 1882 def self.from_hash(data) return nil if data.nil? new( at_least: data['atLeast'], at_most: data['atMost'] ) end |
.once ⇒ Object
1903 1904 1905 |
# File 'lib/mockserver/models.rb', line 1903 def self.once new(at_least: 1, at_most: 1) end |
Instance Method Details
#to_h ⇒ Object
1875 1876 1877 1878 1879 1880 |
# File 'lib/mockserver/models.rb', line 1875 def to_h MockServer.strip_none({ 'atLeast' => @at_least, 'atMost' => @at_most }) end |