Sha256: 68345a99d90296705981d138bc614e79035bcbd01e27db27942c4fd6725dd5ad

Contents?: true

Size: 357 Bytes

Versions: 1

Compression:

Stored size: 357 Bytes

Contents

require 'mayu/relation'

module Mayu
  Device = Struct.new(:key, :user_key, :mac, :kind, :note, keyword_init: true) do
    include Mayu::Relation

    def self.load(obj)
      new(**obj)
    end

    relates :user

    relates :association

    def as_json
      {
        key: key,
        user_key: user_key,
        kind: kind,
      }
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
mayu-0.1.0.beta1 lib/mayu/device.rb