Sha256: 865b8c8feec1826bc488b5d849fc6ce39a48a12fc57001679b2a9758bcca1c82

Contents?: true

Size: 724 Bytes

Versions: 6

Compression:

Stored size: 724 Bytes

Contents

module Troo
  module External
    class BoardAdaptor
      class << self
        def adapt(resource)
          new(resource).adapted
        end
      end

      def initialize(resource)
        @resource = resource
      end

      def adapted
        {
          external_board_id: external_board_id,
          name:              name,
          description:       description,
          closed:            closed,
        }
      end

      private
      attr_reader :resource

      def external_board_id
        resource.id
      end

      def name
        resource.name
      end

      def description
        resource.description
      end

      def closed
        resource.closed.to_s
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
troo-0.0.7 lib/troo/external/board_adaptor.rb
troo-0.0.6 lib/troo/external/board_adaptor.rb
troo-0.0.5 lib/troo/external/board_adaptor.rb
troo-0.0.4 lib/troo/external/board_adaptor.rb
troo-0.0.3 lib/troo/external/board_adaptor.rb
troo-0.0.2 lib/troo/external/board_adaptor.rb