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



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

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



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

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


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

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



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

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