Sha256: 0a6c4f32ccf22c311d5686a1da02b7fb647ee775995b1f6d8c4cf9b7cf5ee2c7

Contents?: true

Size: 467 Bytes

Versions: 5

Compression:

Stored size: 467 Bytes

Contents

module Feste
  module User
    def self.included(klass)
      klass.include InstanceMethods
      klass.class_eval do
        has_many(
          :subscriptions,
          class_name: "Feste::Subscription",
          as: :subscriber
        )
      end
    end

    module InstanceMethods
      # Return the email address of the subscriber.
      #
      # @return [String]
      def email_source
        send(Feste.options[:email_source])
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
feste-0.4.2 lib/feste/user.rb
feste-0.4.1 lib/feste/user.rb
feste-0.4.0 lib/feste/user.rb
feste-0.3.0 lib/feste/user.rb
feste-0.2.1 lib/feste/user.rb