module DirModel::Model::Files::ClassMethods

Public Instance Methods

file_name() click to toggle source

@return [Array<Symbol>] file names for the row model

# File lib/dir_model/model/files.rb, line 13
def file_name
  files.keys.first
end
index(file_name) click to toggle source

@param [Symbol] file_name name of file to find index @return [Integer] index of the file_name

# File lib/dir_model/model/files.rb, line 25
def index(file_name)
  0
end
options() click to toggle source

@param [Symbol] file_name name of file to find option @return [Hash] options for the file_name

# File lib/dir_model/model/files.rb, line 19
def options
  files[file_name]
end

Protected Instance Methods

file(file_name, options={}) click to toggle source
# File lib/dir_model/model/files.rb, line 31
def file(file_name, options={})
  files_object.merge(file_name.to_sym => options)
  raise ArgumentError.new("You cannot define more of one file: but you can add relations, see README") if files.keys.size > 1
end