Class: Embulk::Input::HealthplanetApi::Column

Inherits:
Object
  • Object
show all
Defined in:
lib/embulk/input/hpbloodpressure_api/column2.rb

Instance Method Summary collapse

Constructor Details

#initialize(lang) ⇒ Column

Returns a new instance of Column.



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/embulk/input/hpbloodpressure_api/column2.rb', line 8

def initialize(lang)
  case lang.downcase
  when 'ja', 'japanese'
    @names = {
      :time           => '測定日時',
      :model          => 'モデル',
      :high           => '最高血圧',
      :low            => '最低血圧',
      :heartbeat      => '脈拍',
    }
  when 'en', 'english'
    @names = {
      :time           => 'time',
      :model          => 'model',
      :high           => 'high',
      :low            => 'low',
      :heartbeat      => 'heartbeat',
    }
  else
    # returns as-is API tag
    @names = {
      :time           => 'time',
      :model          => 'model',
      :high           => '622E',
      :low            => '622F',
      :heartbeat      => '6230',
    }
  end
end

Instance Method Details

#name(key) ⇒ Object



38
39
40
# File 'lib/embulk/input/hpbloodpressure_api/column2.rb', line 38

def name(key)
  @names[key]
end