Module: Familia::Horreum::Settings

Included in:
Familia::Horreum
Defined in:
lib/familia/horreum/settings.rb

Overview

Settings - Instance-level configuration methods for Horreum models Provides per-instance settings like logical_database, suffix

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#suffixObject



40
41
42
# File 'lib/familia/horreum/settings.rb', line 40

def suffix
  @suffix || self.class.suffix
end

Instance Method Details

#logical_databaseObject



27
28
29
# File 'lib/familia/horreum/settings.rb', line 27

def logical_database
  @logical_database || self.class.logical_database
end

#logical_database=(v) ⇒ Object



23
24
25
# File 'lib/familia/horreum/settings.rb', line 23

def logical_database=(v)
  @logical_database = v.to_i
end

#optsObject



18
19
20
21
# File 'lib/familia/horreum/settings.rb', line 18

def opts
  @opts ||= {}
  @opts
end

#prefixString

Retrieves the prefix for the current instance by delegating to its class.

Examples:

instance.prefix

Returns:

  • (String)

    The prefix associated with the class of the current instance.



36
37
38
# File 'lib/familia/horreum/settings.rb', line 36

def prefix
  self.class.prefix
end