Sha256: 42f0dcb346896f79f7b2020e1a428a4cb5c41822cabb6b2268a3f782a45f89cd

Contents?: true

Size: 749 Bytes

Versions: 11

Compression:

Stored size: 749 Bytes

Contents

module Gosu
  class Color
    def _dump(level)
      [
        "%02X" % self.alpha,
        "%02X" % self.red,
        "%02X" % self.green,
        "%02X" % self.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, &block)
      if method.to_s.end_with?("=")
        raise "Did not expect more than 1 argument" if args.size > 1
        return @hash[method.to_s.sub("=", "").to_sym] = args.first

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

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

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
cyberarm_engine-0.14.0 lib/cyberarm_engine/ui/style.rb
cyberarm_engine-0.13.1 lib/cyberarm_engine/ui/style.rb
cyberarm_engine-0.12.1 lib/cyberarm_engine/ui/style.rb
cyberarm_engine-0.12.0 lib/cyberarm_engine/ui/style.rb
cyberarm_engine-0.11.1 lib/cyberarm_engine/ui/style.rb
cyberarm_engine-0.11.0 lib/cyberarm_engine/ui/style.rb
cyberarm_engine-0.10.2 lib/cyberarm_engine/ui/style.rb
cyberarm_engine-0.10.1 lib/cyberarm_engine/ui/style.rb
cyberarm_engine-0.10.0 lib/cyberarm_engine/ui/style.rb
cyberarm_engine-0.9.0 lib/cyberarm_engine/ui/style.rb
cyberarm_engine-0.8.1 lib/cyberarm_engine/ui/style.rb