Module: ECFS::Query
- Included in:
- FilingsQuery, ProceedingsQuery
- Defined in:
- lib/ecfs/query.rb
Instance Attribute Summary collapse
-
#constraints ⇒ Object
readonly
Returns the value of attribute constraints.
Instance Method Summary collapse
- #eq(field, value) ⇒ Object
- #format_constraint(constraint) ⇒ Object
- #initialize(params = {}) ⇒ Object
- #query_string ⇒ Object
- #url ⇒ Object
Instance Attribute Details
#constraints ⇒ Object (readonly)
Returns the value of attribute constraints.
3 4 5 |
# File 'lib/ecfs/query.rb', line 3 def constraints @constraints end |
Instance Method Details
#eq(field, value) ⇒ Object
10 11 12 13 |
# File 'lib/ecfs/query.rb', line 10 def eq(field, value) @constraints[field] = value self end |
#format_constraint(constraint) ⇒ Object
15 16 17 |
# File 'lib/ecfs/query.rb', line 15 def format_constraint(constraint) constraints_dictionary[constraint] end |
#initialize(params = {}) ⇒ Object
5 6 7 8 |
# File 'lib/ecfs/query.rb', line 5 def initialize(params={}) @typecast_results = params[:typecast_results] @constraints = {} end |
#query_string ⇒ Object
19 20 21 22 23 |
# File 'lib/ecfs/query.rb', line 19 def query_string @constraints.keys.map do |constraint| format_constraint(constraint) + "=" + @constraints[constraint] end.join("&") end |
#url ⇒ Object
25 26 27 |
# File 'lib/ecfs/query.rb', line 25 def url "#{base_url}?#{query_string}" end |