Sha256: e1c5e685ff9a4a02702a1af052284eaac5ee408078b2fdc6cf0fe025c88e2401

Contents?: true

Size: 716 Bytes

Versions: 1

Compression:

Stored size: 716 Bytes

Contents

#= require lotion/notifications

module Lotion
  class Command
    include Lotion::Notifications

    ##
    #
    def initialize( notification )
      @notification = notification
    end
    attr_reader :notification

    ##
    #
    # TODO this could be a macro on Module
    def call
      raise NotImplementedError, 'Lotion::Command subclasses are expected to define #call'
    end

    ##
    #
    def self.call( notification )
      new( notification ).call
    end

    ##
    # TODO delegate
    def name
      notification.name
    end

    ##
    # TODO delegate
    def object
      notification.object
    end

    ##
    # TODO delegate
    def userInfo
      notification.userInfo
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
lotion-0.1.0 lib/lotion/command.rb