Class: Pulsedive::Indicator

Inherits:
Client
  • Object
show all
Defined in:
lib/pulsedive/indicator.rb

Constant Summary

Constants inherited from Client

Client::HOST, Client::URL

Instance Attribute Summary

Attributes inherited from Client

#api_key

Instance Method Summary collapse

Methods inherited from Client

#initialize

Constructor Details

This class inherits a constructor from Pulsedive::Client

Instance Method Details

#get_by_id(iid, schema = 1) ⇒ Object



4
5
6
7
8
9
10
# File 'lib/pulsedive/indicator.rb', line 4

def get_by_id(iid, schema = 1)
  params = {
    "iid": iid,
    "schema": schema
  }
  get("/api/info.php", params) { |json| json }
end

#get_by_value(indicator) ⇒ Object



12
13
14
15
16
17
# File 'lib/pulsedive/indicator.rb', line 12

def get_by_value(indicator)
  params = {
    "indicator": indicator
  }
  get("/api/info.php", params) { |json| json }
end


19
20
21
22
23
24
25
26
# File 'lib/pulsedive/indicator.rb', line 19

def get_links_by_id(iid, page = 0)
  params = {
    "iid": iid,
    "get": "links",
    "page": page
  }
  get("/api/info.php", params) { |json| json }
end

#get_properties_by_id(iid) ⇒ Object



28
29
30
31
32
33
34
# File 'lib/pulsedive/indicator.rb', line 28

def get_properties_by_id(iid)
  params = {
    "iid": iid,
    "get": "properties"
  }
  get("/api/info.php", params) { |json| json }
end