class ObjectIdentifier::Configuration
ObjectIdentifier::Configuration
stores the default configuration options for the ObjectIdentifier
gem. Modification of attributes is possible at any time, and values will persist for the duration of the running process.
Attributes
Public Class Methods
Source
# File lib/object_identifier/configuration.rb, line 42 def initialize @formatter_class = ObjectIdentifier::StringFormatter @default_attributes = %i[id] end
Public Instance Methods
Source
# File lib/object_identifier/configuration.rb, line 55 def default_attributes=(value) @default_attributes = value.to_a.map!(&:to_sym) end
Source
# File lib/object_identifier/configuration.rb, line 47 def formatter_class=(value) unless value.is_a?(Class) raise(TypeError, "Formatter must be a Class constant") end @formatter_class = value end