Class: Pact::QueryString
Instance Method Summary
collapse
#fix_all_the_things, #fix_json_formatting, #fix_regexp, #remove_unicode, #warn_about_regexp
Constructor Details
Returns a new instance of QueryString.
8
9
10
|
# File 'lib/pact/consumer_contract/query_string.rb', line 8
def initialize query
@query = query.nil? ? query : query.dup
end
|
Instance Method Details
#==(other) ⇒ Object
24
25
26
|
# File 'lib/pact/consumer_contract/query_string.rb', line 24
def == other
QueryString === other && other.query == query
end
|
#as_json(opts = {}) ⇒ Object
12
13
14
|
# File 'lib/pact/consumer_contract/query_string.rb', line 12
def as_json opts = {}
@query
end
|
#difference(other) ⇒ Object
28
29
30
31
|
# File 'lib/pact/consumer_contract/query_string.rb', line 28
def difference(other)
require 'pact/matchers' Pact::Matchers.diff(query, other.query)
end
|
#empty? ⇒ Boolean
41
42
43
|
# File 'lib/pact/consumer_contract/query_string.rb', line 41
def empty?
@query && @query.empty?
end
|
#eql?(other) ⇒ Boolean
20
21
22
|
# File 'lib/pact/consumer_contract/query_string.rb', line 20
def eql? other
self == other
end
|
#nil? ⇒ Boolean
46
47
48
|
# File 'lib/pact/consumer_contract/query_string.rb', line 46
def nil?
@query.nil?
end
|
#query ⇒ Object
33
34
35
|
# File 'lib/pact/consumer_contract/query_string.rb', line 33
def query
@query
end
|
#to_json(opts = {}) ⇒ Object
16
17
18
|
# File 'lib/pact/consumer_contract/query_string.rb', line 16
def to_json opts = {}
as_json(opts).to_json(opts)
end
|
#to_s ⇒ Object
37
38
39
|
# File 'lib/pact/consumer_contract/query_string.rb', line 37
def to_s
@query
end
|