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

Defined in:
lib/rom/files/plugins/schema/contents.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

#contents(name = NAME, inline_type = TYPE, type: inline_type) ⇒ Object

Sets non-default contents attribute

Examples:

Set custom attribute name

schema do
  use :contents
  contents :contents
end

Set custom type

schema do
  use :contents
  contents type: Types::JSON
end


60
61
62
63
64
65
66
# File 'lib/rom/files/plugins/schema/contents.rb', line 60

def contents(name = NAME, inline_type = TYPE, type: inline_type)
  options = plugin_options(:contents)
  options[:name] = name
  options[:type] = type

  self
end