Sha256: e537e3e2e2440bf3e5960ca9def957a0e62169ed68cc0a479439cc7552a3f37f
Contents?: true
Size: 468 Bytes
Versions: 1
Compression:
Stored size: 468 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) 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.2 | lib/wargaming_api/concern/attributable.rb |