Module: HasHelpers::Cards

Defined in:
lib/has_helpers/cards.rb,
lib/has_helpers/cards/cache.rb,
lib/has_helpers/cards/roles.rb,
lib/has_helpers/cards/config.rb,
lib/has_helpers/cards/remote_role.rb,
lib/has_helpers/cards/remote_roles.rb,
app/models/has_helpers/cards/registry.rb,
app/models/has_helpers/cards/card_field.rb,
app/importers/has_helpers/cards/importer.rb,
app/models/has_helpers/cards/card_definition.rb,
app/models/has_helpers/cards/role_card_field.rb,
app/constants/has_helpers/cards/card_data_type.rb,
app/models/has_helpers/cards/card_builder/base.rb,
app/constants/has_helpers/cards/card_identifier.rb,
app/models/has_helpers/cards/role_resource_card.rb,
app/commands/has_helpers/cards/card_data_command.rb,
app/constants/has_helpers/cards/card_layout_type.rb,
app/constants/has_helpers/cards/card_custom_field.rb,
app/constants/has_helpers/cards/card_variant_type.rb,
app/workers/has_helpers/cards/orphan_card_sweeper.rb,
app/models/has_helpers/cards/card_definition_resource.rb,
app/commands/has_helpers/cards/available_cards_command.rb,
app/models/has_helpers/cards/card_builder/field_builder.rb,
app/models/has_helpers/cards/card_builder/resource_builder.rb,
app/models/has_helpers/cards/card_builder/definition_context.rb,
app/models/has_helpers/cards/card_builder/card_definition_builder.rb

Defined Under Namespace

Modules: CardBuilder, Roles Classes: AvailableCardsCommand, Cache, CardCustomField, CardDataCommand, CardDataType, CardDefinition, CardDefinitionResource, CardField, CardIdentifier, CardLayoutType, CardVariantType, Config, ConfigurationError, Error, FetchError, Importer, NotFoundError, OrphanCardSweeper, Registry, RemoteRole, RemoteRoles, RoleCardField, RoleResourceCard

Class Method Summary collapse

Class Method Details

.configObject



24
25
26
# File 'lib/has_helpers/cards.rb', line 24

def config
  @config || raise(ConfigurationError, "HasHelpers::Cards.configure must be called before use")
end

.configure {|config| ... } ⇒ Object

Yields:



17
18
19
20
21
22
# File 'lib/has_helpers/cards.rb', line 17

def configure
  config = Config.new
  yield config
  config.validate!
  @config = config
end

.reset!Object



28
29
30
31
# File 'lib/has_helpers/cards.rb', line 28

def reset!
  @config = nil
  Roles.reset! if defined?(Roles)
end