Class: Ondotori::WebAPI::Api::LatestDataParams

Inherits:
ParamsBase
  • Object
show all
Defined in:
lib/ondotori/webapi/api/params.rb

Instance Method Summary collapse

Constructor Details

#initialize(param, serial: "") ⇒ LatestDataParams

Returns a new instance of LatestDataParams.



44
45
46
47
48
49
50
51
52
# File 'lib/ondotori/webapi/api/params.rb', line 44

def initialize(param, serial: "")
  super(param)
  if serial.empty?
    raise Ondotori::WebAPI::Api::Errors::InvaildParameter.new(
      "latest-data need remote-serial", 9994
    )
  end
  @remote_serial = serial
end

Instance Method Details

#to_ondotori_paramObject



54
55
56
57
58
59
# File 'lib/ondotori/webapi/api/params.rb', line 54

def to_ondotori_param
  params = super
  params["remote-serial"] = @remote_serial

  params
end