Class: JarvisbotSongfinder::Query

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/jarvisbot_songfinder/helpers/query.rb

Overview

Responsible for selecting concrete query and delegating track methods to it

Query.new("Paramore - Decode").title
# => "Decode"

Constant Summary collapse

URL_REGEX =
%r{\Ahttps?:\/\/}.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(input, config: JarvisbotSongfinder.configuration) ⇒ Query

Returns a new instance of Query.



16
17
18
19
20
# File 'lib/jarvisbot_songfinder/helpers/query.rb', line 16

def initialize(input, config: JarvisbotSongfinder.configuration)
  @config = config
  @input = input
  @concrete_query = select_concrete_query
end

Instance Attribute Details

#concrete_queryObject (readonly)

Returns the value of attribute concrete_query.



14
15
16
# File 'lib/jarvisbot_songfinder/helpers/query.rb', line 14

def concrete_query
  @concrete_query
end