Class: MusicBrainz::Webservice::UserFilter
- Inherits:
-
Object
- Object
- MusicBrainz::Webservice::UserFilter
- Defined in:
- lib/rbrainz/webservice/filter.rb
Overview
A filter to query a user by his username.
Instance Method Summary collapse
-
#initialize(name = nil) ⇒ UserFilter
constructor
A new instance of UserFilter.
-
#to_s ⇒ Object
Returns the filter list as a query string (without leading &).
Constructor Details
#initialize(name = nil) ⇒ UserFilter
Returns a new instance of UserFilter.
256 257 258 259 |
# File 'lib/rbrainz/webservice/filter.rb', line 256 def initialize(name=nil) @filter = Hash.new @filter[:name] = name if name end |
Instance Method Details
#to_s ⇒ Object
Returns the filter list as a query string (without leading &).
262 263 264 265 266 |
# File 'lib/rbrainz/webservice/filter.rb', line 262 def to_s @filter.to_a.map {|name, value| '%s=%s' % [URI.escape(name.to_s), URI.escape(value.to_s)] }.join('&') end |