Class: Jackettrb::Request
- Inherits:
-
Object
- Object
- Jackettrb::Request
- Defined in:
- lib/jackettrb/request.rb
Instance Attribute Summary collapse
-
#host ⇒ Object
Returns the value of attribute host.
-
#key ⇒ Object
Returns the value of attribute key.
-
#strict ⇒ Object
Returns the value of attribute strict.
Instance Method Summary collapse
-
#firehose ⇒ Object
rubocop:enable Style/OptionalBooleanParameter.
-
#initialize(host, key, strict = false) ⇒ Request
constructor
rubocop:disable Style/OptionalBooleanParameter.
- #query(q) ⇒ Object
Constructor Details
#initialize(host, key, strict = false) ⇒ Request
rubocop:disable Style/OptionalBooleanParameter
10 11 12 13 14 |
# File 'lib/jackettrb/request.rb', line 10 def initialize(host, key, strict = false) @key = key @host = host @strict = strict end |
Instance Attribute Details
#host ⇒ Object
Returns the value of attribute host.
7 8 9 |
# File 'lib/jackettrb/request.rb', line 7 def host @host end |
#key ⇒ Object
Returns the value of attribute key.
7 8 9 |
# File 'lib/jackettrb/request.rb', line 7 def key @key end |
#strict ⇒ Object
Returns the value of attribute strict.
7 8 9 |
# File 'lib/jackettrb/request.rb', line 7 def strict @strict end |
Instance Method Details
#firehose ⇒ Object
rubocop:enable Style/OptionalBooleanParameter
17 18 19 20 |
# File 'lib/jackettrb/request.rb', line 17 def firehose url = parse_url(@host, nil) parse_rss(url, @strict) end |
#query(q) ⇒ Object
22 23 24 25 |
# File 'lib/jackettrb/request.rb', line 22 def query(q) url = parse_url(@host, "&q=#{q}") parse_rss(url, @strict) end |