Sha256: 905a528ec293f9b8120161edde0d7cfa0b8be0baef0e5e391b891d7a0290127e
Contents?: true
Size: 500 Bytes
Versions: 2
Compression:
Stored size: 500 Bytes
Contents
module WargamingApi::Concern::Attributable def self.included(base) base.extend ClassMethods base.class_eval do cattr_accessor :_attributes self._attributes = {} end end module ClassMethods def attribute(name, type) _attributes[name] = type end end def apply_type(name, value) return value if value.nil? case self._attributes[name.to_sym] when :datetime Time.at(value) else value end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
wargaming_api_ruby-0.1.7 | lib/wargaming_api/concern/attributable.rb |
wargaming_api_ruby-0.1.5 | lib/wargaming_api/concern/attributable.rb |