Sha256: 328e1ad0fc1cb143b49d796a1e7b54027c08c4db48e70c31da3394fac81d4d9a
Contents?: true
Size: 612 Bytes
Versions: 2
Compression:
Stored size: 612 Bytes
Contents
#encoding: utf-8 require 'yaml' module IRemoconControl class IRemoconError < StandardError FILE = File.expand_path(File.dirname(__FILE__)) + "/iremocon_error.yml" DEF = YAML.load_file(FILE) attr_reader :command, :code, :description def initialize(command, code) raise if DEF[@command] @command, @code = command, code @desctiption = DEF[@command][@code] @desctiption ||= DEF["common"][@code] end def to_s @desctiption end def inspect "[#{@command}-#{@code}] #{@desctiption}" end end end # vim: sw=2 ts=2 sts=2 et
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
iremocon_control-0.1.1 | lib/iremocon_control/iremocon_error.rb |
iremocon_control-0.1.0 | lib/iremocon_control/iremocon_error.rb |