Sha256: 2378bfd446e862da9cefd01bf29d4ee467b54bc2457e33037917ab8a73403695

Contents?: true

Size: 256 Bytes

Versions: 46

Compression:

Stored size: 256 Bytes

Contents

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

Version data entries

46 entries across 46 versions & 2 rubygems

Version Path
inbox-0.15.3 lib/time_attr_accessor.rb
inbox-0.15.2 lib/time_attr_accessor.rb
inbox-0.15.1 lib/time_attr_accessor.rb
inbox-0.15.0 lib/time_attr_accessor.rb
inbox-0.14.1 lib/time_attr_accessor.rb
inbox-0.14.0 lib/time_attr_accessor.rb