Class: BetterUri::Query

Inherits:
Object
  • Object
show all
Defined in:
lib/better_uri/query.rb

Instance Method Summary collapse

Constructor Details

#initialize(uri) ⇒ Query

Returns a new instance of Query.



15
16
17
# File 'lib/better_uri/query.rb', line 15

def initialize(uri)
  @uri = uri
end

Instance Method Details

#except(*args, &block) ⇒ Object



35
36
37
38
39
# File 'lib/better_uri/query.rb', line 35

def except(*args, &block)
  @uri.dup.tap do |uri|
    uri.query_string = build_query_string(parsed_query.except(*args, &block))
  end
end

#except!(*args, &block) ⇒ Object



41
42
43
44
45
# File 'lib/better_uri/query.rb', line 41

def except!(*args, &block)
  @uri.tap do |uri|
    uri.query_string = build_query_string(parsed_query.except(*args, &block))
  end
end

#merge(*args, &block) ⇒ Object



23
24
25
26
27
# File 'lib/better_uri/query.rb', line 23

def merge(*args, &block)
  @uri.dup.tap do |uri|
    uri.query_string = build_query_string(parsed_query.merge(*args, &block))
  end
end

#merge!(*args, &block) ⇒ Object



29
30
31
32
33
# File 'lib/better_uri/query.rb', line 29

def merge!(*args, &block)
  @uri.tap do |uri|
    uri.query_string = build_query_string(parsed_query.merge(*args, &block))
  end
end

#to_sObject



19
20
21
# File 'lib/better_uri/query.rb', line 19

def to_s
  @uri.query_string
end