Module: ROM::Files::Plugins::Schema::Stat::DSL Private

Defined in:
lib/rom/files/plugins/schema/stat.rb

This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.

Instance Method Summary collapse

Instance Method Details

#stat(name = NAME, stats: EMPTY_ARRAY, aliases: EMPTY_HASH) ⇒ Object

Examples:

Sets non-default list of stat properties

schema do
  use :stat
  stat :basename
end

Sets list of aliased properties

schema do
  use :stat
  stat aliased: { created_at: :ctime }
end


95
96
97
98
99
100
101
102
# File 'lib/rom/files/plugins/schema/stat.rb', line 95

def stat(name = NAME, stats: EMPTY_ARRAY, aliases: EMPTY_HASH)
  options = plugin_options(:stat)
  options[:name] = name
  options[:stats] = stats
  options[:aliases] = aliases

  self
end