class Mingle::CardType

This is a lightweight representation of a card type in Mingle. From an instance of this class you can the name, color and position of the card type, in addition to Property Definitions that are associated with it.

Attributes

card_types_property_definitions_loader[W]

Public Class Methods

new(full_card_type) click to toggle source
# File lib/mingle_macro_models/card_type.rb, line 9
def initialize(full_card_type)
  @full_card_type = full_card_type
end

Public Instance Methods

color() click to toggle source

returns: The hex color code for this CardType

# File lib/mingle_macro_models/card_type.rb, line 19
def color
  @full_card_type.color.gsub('#', '')
end
name() click to toggle source

returns: The name of this CardType

# File lib/mingle_macro_models/card_type.rb, line 14
def name
  @full_card_type.name
end
position() click to toggle source

returns: The position of this CardType among all the CardTypes on the project. The first card type has position 1

# File lib/mingle_macro_models/card_type.rb, line 25
def position
  @full_card_type.position
end
property_definitions() click to toggle source

returns: The PropertyDefinitions associated with this CardType

# File lib/mingle_macro_models/card_type.rb, line 30
def property_definitions
  @card_types_property_definitions_loader.load.collect(&:property_definition)
end
to_s() click to toggle source
# File lib/mingle_macro_models/card_type.rb, line 34
def to_s
  "CardType[name=#{name},color=#{color},position=#{position}]"
end