Class: DssReuters::Api

Inherits:
Object
  • Object
show all
Defined in:
lib/dss_reuters.rb

Instance Method Summary collapse

Constructor Details

#initializeApi

Returns a new instance of Api.



137
138
139
# File 'lib/dss_reuters.rb', line 137

def initialize
  @session = Session.new
end

Instance Method Details

#extract_with_isin(isin_code, type = :composite, fields = nil, condition = nil) ⇒ Object



149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
# File 'lib/dss_reuters.rb', line 149

def extract_with_isin(isin_code, type=:composite, fields=nil, condition=nil)
  fields ||= [
    "Close Price",
    "Contributor Code Description",
    "Currency Code Description",
    "Dividend Yield",
    "Main Index",
    "Market Capitalization",
    "Market Capitalization - Local Currency",
    "Percent Change - Close Price - 1 Day",
    "Universal Close Price Date"
  ]
  identifiers = [
    {
      "Identifier" => isin_code,
     "IdentifierType" => "Isin"
    }
  ]
  OnDemandExtract.new(@session, identifiers, type, fields, condition)
end

#extract_with_location(location) ⇒ Object



145
146
147
# File 'lib/dss_reuters.rb', line 145

def extract_with_location(location)
  OnDemandExtract.init_with_location(@session, location)
end

#get_userObject



141
142
143
# File 'lib/dss_reuters.rb', line 141

def get_user
  @user = User.new(@session)
end