Class: RESTfulLoaders::PropertyDefinitionLoader

Inherits:
Object
  • Object
show all
Defined in:
lib/mingle_macro_development_toolkit/loaders/restful_loaders/property_definition_loader.rb

Instance Method Summary collapse

Constructor Details

#initialize(project, pd) ⇒ PropertyDefinitionLoader

Returns a new instance of PropertyDefinitionLoader.



4
5
6
7
# File 'lib/mingle_macro_development_toolkit/loaders/restful_loaders/property_definition_loader.rb', line 4

def initialize(project, pd)
  @project = project
  @pd = pd
end

Instance Method Details

#loadObject



13
14
15
16
17
18
# File 'lib/mingle_macro_development_toolkit/loaders/restful_loaders/property_definition_loader.rb', line 13

def load
  @property_definition = Mingle::PropertyDefinition.new(OpenStruct.new(@pd))
  @property_definition.card_types_property_definitions_loader = CardTypesPropertyDefinitionsLoader.new(@project, 'property_definition_id' => @pd['id'])
  @property_definition.values_loader = PropertyValuesLoader.new(@pd)
  @property_definition
end

#property_definitionObject



9
10
11
# File 'lib/mingle_macro_development_toolkit/loaders/restful_loaders/property_definition_loader.rb', line 9

def property_definition
  @property_definition ||= load
end