Sha256: a33e12cbc5339d314f39975f260fa1f958217c0cdac751b4a0d650d3b1bbb097

Contents?: true

Size: 772 Bytes

Versions: 3

Compression:

Stored size: 772 Bytes

Contents

module Troo
  class List < Ohm::Model
    include Ohm::DataTypes
    include ModelHelpers

    attribute :name
    attribute :position, Type::Integer
    attribute :default, Type::Boolean
    attribute :closed, Type::Boolean
    attribute :external_board_id
    attribute :external_list_id

    index :default
    index :external_board_id
    index :external_list_id

    alias_method :default?, :default

    def board
      BoardRetrieval.retrieve(self.external_board_id)
    end

    def cards
      Troo::Card.find(external_list_id: self.external_list_id)
    end

    def decorator(options = {})
      ListDecorator.new(self, options)
    end

    def presenter
      ListPresenter.new(self)
    end

    def set_default!
      SetDefault.for(self)
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
troo-0.0.7 lib/troo/models/list.rb
troo-0.0.6 lib/troo/models/list.rb
troo-0.0.5 lib/troo/models/list.rb