Module: Golden::Setting::Name::ClassMethods

Defined in:
lib/golden/setting/name.rb

Instance Method Summary collapse

Instance Method Details

#first_or_new_object(name) ⇒ Object



23
24
25
# File 'lib/golden/setting/name.rb', line 23

def first_or_new_object name
  named(name).first_or_initialize
end

#named(name) ⇒ Object



10
11
12
13
# File 'lib/golden/setting/name.rb', line 10

def named name
  raise Error::SettingNoMethod, :named unless defined? super
  super
end

#new_object(name) ⇒ Object



19
20
21
# File 'lib/golden/setting/name.rb', line 19

def new_object name
  named(name).new
end

#object(name) ⇒ Object



15
16
17
# File 'lib/golden/setting/name.rb', line 15

def object name
  named(name).first
end