Sha256: 132ff69cfcc0ed0428b063d7ef58416c2d694c8762d7c3b720e33d02ba96a0e2

Contents?: true

Size: 688 Bytes

Versions: 1

Compression:

Stored size: 688 Bytes

Contents

# Abstract class to be inherited from adapter class.
#
# Example:
#
#   # Used as `ellen --adapter=my_adapter`
#   class MyAdapter < Ellen::Adapters::Base
#     def run
#       ... do your work ...
#     end
#   end
#
module Ellen
  module Adapters
    class Base
      include Env::Validatable

      class << self
        def inherited(child_class)
          Ellen::AdapterBuilder.adapter_classes << child_class
        end
      end

      attr_reader :robot

      def initialize(robot)
        @robot = robot
        validate
      end

      def say(body, options = {})
        Ellen.logger.info("Not implemented #{self.class}##{__method__} was called")
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ellen-0.1.1 lib/ellen/adapters/base.rb