Sha256: 883ed96c70bb8e62b5b5ab6e1386eeecc383fe4be2694c2a7cfc75a7d93c7f10

Contents?: true

Size: 479 Bytes

Versions: 1

Compression:

Stored size: 479 Bytes

Contents

# frozen_string_literal: true

module TaskWarrior
  module Attributes
    module ClassMethods
      def attributes(*attr)
        if attr.nil? || attr.empty?
          @attributes
        else
          @attributes = attr
          @attributes.each { |attr| send('attr_accessor', attr) }
        end
      end
    end

    # http://blog.jayfields.com/2006/12/ruby-instance-and-class-methods-from.html
    def self.included(base)
      base.extend(ClassMethods)
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
taskwarrior-1.0.0 lib/taskwarrior/attributes.rb