Class: Medicapi::Symptom
- Inherits:
-
Object
- Object
- Medicapi::Symptom
- Defined in:
- lib/medicapi.rb
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(input_options) ⇒ Symptom
constructor
A new instance of Symptom.
Constructor Details
#initialize(input_options) ⇒ Symptom
Returns a new instance of Symptom.
7 8 9 10 11 |
# File 'lib/medicapi.rb', line 7 def initialize() @id = ["ID"].to_i @name = ["Name"] end |
Instance Attribute Details
#id ⇒ Object (readonly)
Returns the value of attribute id.
6 7 8 |
# File 'lib/medicapi.rb', line 6 def id @id end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
6 7 8 |
# File 'lib/medicapi.rb', line 6 def name @name end |
Class Method Details
.all(token) ⇒ Object
12 13 14 15 16 17 18 19 |
# File 'lib/medicapi.rb', line 12 def self.all(token) ruby_data = [] bulk_data = Unirest.get("https://healthservice.priaid.ch/symptoms?token=#{token}&language=en-gb&format=json").body bulk_data.each do |symptom| ruby_data << Symptom.new(symptom) end ruby_data end |