Sha256: 0c2f15871764788df0f6b17ac22db31322d0ebb428de9f96154951ecfb56d308

Contents?: true

Size: 913 Bytes

Versions: 2

Compression:

Stored size: 913 Bytes

Contents

module Troo
  module Remote
    class List
      include Virtus.model(finalize: false)
      include Troo::RemoteModelHelpers

      attribute :id
      attribute :name
      attribute :closed,  Boolean
      attribute :idBoard
      attribute :pos,     Integer

      class << self
        def remote_options
          { mode: :list }
        end

        def by_board_id
          {
            endpoint: :lists_by_board_id,
            query:    { filter: :open }
          }
        end

        def by_list_id
          { endpoint: :list_by_id }
        end
      end

      def associations
        []
      end

      def local_model
        Troo::List
      end

      def adapted
        {
          external_board_id: idBoard,
          external_id:       id,
          name:              name,
          position:          pos,
          closed:            closed
        }
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
troo-0.0.10 lib/troo/remote/list.rb
troo-0.0.9 lib/troo/remote/list.rb