Sha256: e5e52e2bbeb8240c9f0ad33e8049bc71e511684ac55f31c540ca48bb3c8d069b

Contents?: true

Size: 515 Bytes

Versions: 1

Compression:

Stored size: 515 Bytes

Contents

module EnoughFields
  class Notification
    attr_accessor :notifier

    def initialize(call_stack, klass, fields)
      @call_stack = call_stack
      @klass = klass
      @fields = fields
    end

    def full_notice
      "add .only(#{(@klass.fields.keys - @fields).inspect}) for\n#{@call_stack.join("\n")}"
    end

    def notify_inline
      self.notifier.inline_notify( self.full_notice )
    end

    def notify_out_of_channel
      self.notifier.out_of_channel_notify( self.full_notice )
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
enough_fields-0.0.1 lib/enough_fields/notification.rb