Sha256: 24f9465183ba7526a55caa9336d149abee808d225352d2b9a7e77f09866e9031
Contents?: true
Size: 471 Bytes
Versions: 26
Compression:
Stored size: 471 Bytes
Contents
# -*- coding: utf-8 -*- require 'smalruby/hardware' require 'delegate' module Smalruby module Hardware # 何もしないハードウェアを表現するクラス class NullHardware def initialize(*_) end def method_missing(*_name) @null ||= NullHardware.new end %i(& ^ nil? to_a to_f to_i to_s |).each do |sym| define_method sym do |*args| nil.send(sym, *args) end end end end end
Version data entries
26 entries across 26 versions & 1 rubygems