Class: Archivist::Client::Filters
- Inherits:
-
Object
- Object
- Archivist::Client::Filters
- Defined in:
- lib/archivist/client/filters.rb
Overview
Filters class manages the available filters that are configured to work with Archive.org The public API is very simple, and is used to create Archive.org query strings:
filters = Filters.new()
query = filters.to_query
Defined Under Namespace
Classes: FilterException
Constant Summary collapse
- STANDARD_OPTIONS =
[ :filters, :language, :start_year, :end_year, :identifier ]
- DEFAULT_FILTERS =
[ 'mediatype:texts', '-mediatype:collection' ]
Instance Attribute Summary collapse
-
#end_year ⇒ Object
Returns the value of attribute end_year.
-
#filters ⇒ Object
Returns the value of attribute filters.
-
#language ⇒ Object
Returns the value of attribute language.
-
#options ⇒ Object
Returns the value of attribute options.
-
#start_year ⇒ Object
Returns the value of attribute start_year.
Instance Method Summary collapse
-
#initialize(opts) ⇒ Filters
constructor
A new instance of Filters.
- #update(opts) ⇒ Object
Constructor Details
#initialize(opts) ⇒ Filters
Returns a new instance of Filters.
28 29 30 31 |
# File 'lib/archivist/client/filters.rb', line 28 def initialize(opts) @options = {} self.update(opts) end |
Instance Attribute Details
#end_year ⇒ Object
Returns the value of attribute end_year.
23 24 25 |
# File 'lib/archivist/client/filters.rb', line 23 def end_year @end_year end |
#filters ⇒ Object
Returns the value of attribute filters.
23 24 25 |
# File 'lib/archivist/client/filters.rb', line 23 def filters @filters end |
#language ⇒ Object
Returns the value of attribute language.
23 24 25 |
# File 'lib/archivist/client/filters.rb', line 23 def language @language end |
#options ⇒ Object
Returns the value of attribute options.
23 24 25 |
# File 'lib/archivist/client/filters.rb', line 23 def @options end |
#start_year ⇒ Object
Returns the value of attribute start_year.
23 24 25 |
# File 'lib/archivist/client/filters.rb', line 23 def start_year @start_year end |
Instance Method Details
#update(opts) ⇒ Object
33 34 35 36 37 38 39 |
# File 'lib/archivist/client/filters.rb', line 33 def update(opts) self.(opts) self.set_language self.set_years self.set_identifier self.set_filters end |