Class: FixtureLoaders::CardTypeLoader

Inherits:
Base
  • Object
show all
Defined in:
lib/mingle_macro_development_toolkit/loaders/fixture_loaders/card_type_loader.rb

Instance Method Summary collapse

Methods inherited from Base

#initialize, #load_fixtures_for, #match?

Constructor Details

This class inherits a constructor from FixtureLoaders::Base

Instance Method Details

#card_typeObject



4
5
6
# File 'lib/mingle_macro_development_toolkit/loaders/fixture_loaders/card_type_loader.rb', line 4

def card_type
  @card_type ||= load
end

#loadObject



8
9
10
11
12
13
# File 'lib/mingle_macro_development_toolkit/loaders/fixture_loaders/card_type_loader.rb', line 8

def load
  record = load_fixtures_for('card_types').find {|ct| match?(ct)}
  card_type = Mingle::CardType.new(OpenStruct.new(record))
  card_type.card_types_property_definitions_loader = CardTypesPropertyDefinitionsLoader.new('card_type_id' => record['id'])
  card_type
end