Sha256: bf3dd9aa5916c98c9c8cb3a704f86c81eb0e9c55559be1327d59d96dad1239fb
Contents?: true
Size: 502 Bytes
Versions: 1
Compression:
Stored size: 502 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 then Time.utc.at(value) else value end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
wargaming_api_ruby-0.1.3 | lib/wargaming_api/concern/attributable.rb |