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.



13
14
15
# File 'lib/better_uri/query.rb', line 13

def initialize(uri)
  @uri = uri
end

Instance Method Details

#except(*args, &block) ⇒ Object



33
34
35
36
37
# File 'lib/better_uri/query.rb', line 33

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



39
40
41
42
43
# File 'lib/better_uri/query.rb', line 39

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



21
22
23
24
25
# File 'lib/better_uri/query.rb', line 21

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



27
28
29
30
31
# File 'lib/better_uri/query.rb', line 27

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

#to_sObject



17
18
19
# File 'lib/better_uri/query.rb', line 17

def to_s
  @uri.query_string
end