class SDN::Message::PostMotorLimits

Constants

MSG
PARAMS_LENGTH

Attributes

down_limit[RW]
up_limit[RW]

Public Class Methods

new(up_limit = nil, down_limit = nil, **kwargs) click to toggle source
Calls superclass method SDN::Message::new
# File lib/sdn/message/post.rb, line 75
def initialize(up_limit = nil, down_limit = nil, **kwargs)
  super(**kwargs)
  self.up_limit = up_limit
  self.down_limit = down_limit
end

Public Instance Methods

params() click to toggle source
# File lib/sdn/message/post.rb, line 87
def params
  from_number(up_limit, 2) + from_number(down_limit, 2)
end
parse(params) click to toggle source
Calls superclass method SDN::Message::parse
# File lib/sdn/message/post.rb, line 81
def parse(params)
  super
  self.up_limit = to_number(params[0..1], nillable: true)
  self.down_limit = to_number(params[2..3], nillable: true)
end