Class: Ondotori::WebAPI::Api::LatestDataRTR500Params

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

Instance Method Summary collapse

Constructor Details

#initialize(param, base: "", remote: "") ⇒ LatestDataRTR500Params

Returns a new instance of LatestDataRTR500Params.



63
64
65
66
67
68
69
70
71
72
# File 'lib/ondotori/webapi/api/params.rb', line 63

def initialize(param, base: "", remote: "")
  super(param)
  if base.empty? || remote.empty?
    raise Ondotori::WebAPI::Api::Errors::InvaildParameter.new(
      "latest-data-rtr500 need both the  baseunit serial and remote unit serial.", 9993
    )
  end
  @base_serial = base
  @remote_serial = remote
end

Instance Method Details

#to_ondotori_paramObject



74
75
76
77
78
79
80
# File 'lib/ondotori/webapi/api/params.rb', line 74

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

  params
end