Class: Plutonium::Kanban::Board
- Inherits:
-
Object
- Object
- Plutonium::Kanban::Board
- Defined in:
- lib/plutonium/kanban/board.rb
Constant Summary collapse
- VALID_SHOW_IN =
nil means "inherit the definition's show_in"; the board only overrides when explicitly set to :modal or :page.
[nil, :modal, :page].freeze
Instance Attribute Summary collapse
-
#card_fields ⇒ Object
readonly
Returns the value of attribute card_fields.
-
#columns ⇒ Object
readonly
Returns the value of attribute columns.
-
#columns_block ⇒ Object
readonly
Returns the value of attribute columns_block.
-
#per_column ⇒ Object
readonly
Returns the value of attribute per_column.
-
#position_config ⇒ Object
readonly
Returns the value of attribute position_config.
-
#show_in ⇒ Object
readonly
Returns the value of attribute show_in.
Instance Method Summary collapse
- #dynamic? ⇒ Boolean
-
#initialize(columns:, columns_block:, card_fields:, per_column:, realtime:, position_config:, lazy:, show_in: nil) ⇒ Board
constructor
A new instance of Board.
- #lazy? ⇒ Boolean
- #realtime? ⇒ Boolean
-
#show_in_for(definition) ⇒ Object
Resolves the board's effective show_in, falling back to the definition's
show_inwhen the board doesn't override it.
Constructor Details
#initialize(columns:, columns_block:, card_fields:, per_column:, realtime:, position_config:, lazy:, show_in: nil) ⇒ Board
Returns a new instance of Board.
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/plutonium/kanban/board.rb', line 12 def initialize(columns:, columns_block:, card_fields:, per_column:, realtime:, position_config:, lazy:, show_in: nil) unless VALID_SHOW_IN.include?(show_in) raise ArgumentError, "show_in must be one of #{VALID_SHOW_IN.compact.inspect} (or unset), got #{show_in.inspect}" end @columns = columns @columns_block = columns_block @card_fields = card_fields @per_column = per_column @realtime = realtime @position_config = position_config @lazy = lazy @show_in = show_in @columns.each(&:freeze) @columns.freeze @card_fields&.freeze freeze end |
Instance Attribute Details
#card_fields ⇒ Object (readonly)
Returns the value of attribute card_fields.
6 7 8 |
# File 'lib/plutonium/kanban/board.rb', line 6 def card_fields @card_fields end |
#columns ⇒ Object (readonly)
Returns the value of attribute columns.
6 7 8 |
# File 'lib/plutonium/kanban/board.rb', line 6 def columns @columns end |
#columns_block ⇒ Object (readonly)
Returns the value of attribute columns_block.
6 7 8 |
# File 'lib/plutonium/kanban/board.rb', line 6 def columns_block @columns_block end |
#per_column ⇒ Object (readonly)
Returns the value of attribute per_column.
6 7 8 |
# File 'lib/plutonium/kanban/board.rb', line 6 def per_column @per_column end |
#position_config ⇒ Object (readonly)
Returns the value of attribute position_config.
6 7 8 |
# File 'lib/plutonium/kanban/board.rb', line 6 def position_config @position_config end |
#show_in ⇒ Object (readonly)
Returns the value of attribute show_in.
6 7 8 |
# File 'lib/plutonium/kanban/board.rb', line 6 def show_in @show_in end |
Instance Method Details
#dynamic? ⇒ Boolean
33 |
# File 'lib/plutonium/kanban/board.rb', line 33 def dynamic? = !@columns_block.nil? |
#lazy? ⇒ Boolean
32 |
# File 'lib/plutonium/kanban/board.rb', line 32 def lazy? = !!@lazy |
#realtime? ⇒ Boolean
31 |
# File 'lib/plutonium/kanban/board.rb', line 31 def realtime? = !!@realtime |
#show_in_for(definition) ⇒ Object
Resolves the board's effective show_in, falling back to the definition's
show_in when the board doesn't override it. Pass the resource definition.
37 |
# File 'lib/plutonium/kanban/board.rb', line 37 def show_in_for(definition) = @show_in || definition.show_in |