Module: ECFS::Query

Included in:
FilingsQuery, ProceedingsQuery
Defined in:
lib/ecfs/query.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#constraintsObject (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_stringObject



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

#urlObject



25
26
27
# File 'lib/ecfs/query.rb', line 25

def url
  "#{base_url}?#{query_string}"
end