Method: Brief::Document#model_class

Defined in:
lib/brief/document.rb

#model_classObject



201
202
203
204
205
206
207
208
209
210
211
212
213
214
# File 'lib/brief/document.rb', line 201

def model_class
  case
  when @model_class
    @model_class
  when briefcase
    briefcase.model_class_for(self)
  when data && data.type
    Brief::Model.for_type(data.type)
  when parent_folder_name.length > 0
    Brief::Model.for_folder_name(parent_folder_name)
  else
    raise 'Could not determine the model class to use for this document. Specify the type, or put it in a folder that maps to the correct type.'
  end
end