Sha256: 0e4e47776497f98c75ee2c32e15a3c541ed0f6a301b307c7b5a83275ee5c9d3a

Contents?: true

Size: 223 Bytes

Versions: 8

Compression:

Stored size: 223 Bytes

Contents

module Inbox
  module TimeAttrAccessor
    def time_attr_accessor(attr)
      parameter attr
      define_method "#{attr}=" do |value|
        instance_variable_set "@#{attr}", Time.at(value).utc
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
inbox-0.13.0 lib/time_attr_accessor.rb
inbox-0.12.0 lib/time_attr_accessor.rb
inbox-0.11.0 lib/time_attr_accessor.rb
inbox-0.10.1 lib/time_attr_accessor.rb
inbox-0.10.0 lib/time_attr_accessor.rb
inbox-0.9.0 lib/time_attr_accessor.rb
inbox-0.8.1 lib/time_attr_accessor.rb
inbox-0.8.0 lib/time_attr_accessor.rb