Sha256: 37aab155ed6de8a5d44a39e26b8fa24ff7d55a43950232eb62ebaf8f8b1aba49

Contents?: true

Size: 502 Bytes

Versions: 1

Compression:

Stored size: 502 Bytes

Contents

module Calil
  class Library
    *@@library_infos = %w(systemid systemname libkey libid short formal url_pc address pref city post tel geocode category image	distance).map{|str| str.to_sym}

    attr_accessor *@@library_infos

    def initialize(hash = nil)
      hash ||= {}
      hash.each do |k,v|
        self.send("#{k}=", v) if respond_to? "#{k}="
      end
    end

    def to_h
      Hash[*@@library_infos.map{|v| [v, send(v)] }.flatten]
    end

    def to_a
      to_h.to_a
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
calilen-0.1.1 lib/calil/library.rb