Sha256: 2bd16dbe2c3ba4a0e8ff3c470639b1b8adc6f80d25352cfadd8ba6d03dbd5442

Contents?: true

Size: 1.26 KB

Versions: 1

Compression:

Stored size: 1.26 KB

Contents

module Troo
  module Adaptors
    class Card < Resource
      def adapted
        {
          external_board_id:   external_board_id,
          external_list_id:    external_list_id,
          external_card_id:    external_card_id,
          external_member_ids: external_member_ids,
          short_id:            short_id,
          name:                name,
          desc:                desc,
          url:                 url,
          position:            position,
          last_activity_date:  last_activity_date,
          closed:              closed
        }
      end

      private

      def external_board_id
        resource.board_id
      end

      def external_list_id
        resource.list_id
      end

      def external_card_id
        resource.id
      end

      def external_member_ids
        resource.member_ids.to_s.gsub(' ', '')
      end

      def short_id
        resource.short_id.to_s
      end

      def name
        resource.name
      end

      def desc
        resource.desc
      end

      def url
        resource.url
      end

      def position
        resource.pos.to_s
      end

      def last_activity_date
        resource.last_activity_date.to_s
      end

      def closed
        resource.closed.to_s
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
troo-0.0.8 lib/troo/adaptors/card.rb