Sha256: 87ce008bcb84f5a56ee7b6a947d78b90e168b9249fd498d98c41e1fec5fe6dd4

Contents?: true

Size: 710 Bytes

Versions: 4

Compression:

Stored size: 710 Bytes

Contents

module Gosu
  class Color
    def _dump(_level)
      [
        "%02X" % alpha,
        "%02X" % red,
        "%02X" % green,
        "%02X" % blue
      ].join
    end

    def self._load(hex)
      argb(hex.to_i(16))
    end
  end
end

module CyberarmEngine
  class Style
    def initialize(hash = {})
      @hash = Marshal.load(Marshal.dump(hash))
    end

    def method_missing(method, *args)
      if method.to_s.end_with?("=")
        raise "Did not expect more than 1 argument" if args.size > 1

        @hash[method.to_s.sub("=", "").to_sym] = args.first

      elsif args.size == 0
        @hash[method]

      else
        raise ArgumentError, "Did not expect arguments"
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
cyberarm_engine-0.17.1 lib/cyberarm_engine/ui/style.rb
cyberarm_engine-0.17.0 lib/cyberarm_engine/ui/style.rb
cyberarm_engine-0.16.0 lib/cyberarm_engine/ui/style.rb
cyberarm_engine-0.15.0 lib/cyberarm_engine/ui/style.rb