Module: Codelocks::NetCode

Defined in:
lib/codelocks/net_code.rb,
lib/codelocks/net_code/request.rb,
lib/codelocks/net_code/response.rb

Defined Under Namespace

Classes: Request, Response

Class Method Summary collapse

Class Method Details

.generate_netcode(lock_id: nil, start_time: Time.now, duration: nil) ⇒ Codelocks::NetCode::Response

Predefined method for generating a new NetCode


12
13
14
15
16
17
18
19
# File 'lib/codelocks/net_code.rb', line 12

def generate_netcode(lock_id: nil, start_time: Time.now, duration: nil)
  Request.create("netcode/ncgenerator/getnetcode", {
    id: "N#{lock_id}",
    sd: start_time.strftime("%d/%m/%Y"),
    st: start_time.strftime("%H"),
    du: convert_duration(duration)
  })
end