Class: Rapid::Setting::StringSetting

Inherits:
Base
  • Object
show all
Defined in:
lib/rapid/setting/string_setting.rb

Instance Attribute Summary

Attributes inherited from Base

#default_value, #full_name, #name, #namespace

Instance Method Summary collapse

Methods inherited from Base

#define_helpers, #initialize

Constructor Details

This class inherits a constructor from Rapid::Setting::Base

Instance Method Details

#load(value) ⇒ Object



6
7
8
9
10
11
12
13
14
# File 'lib/rapid/setting/string_setting.rb', line 6

def load value
  if value == nil || value == false
    nil
  elsif value.is_a?(Array) || value.is_a?(Hash)
    raise Rapid::InvalidSettingError.new(self, value)
  else
    value.to_s
  end
end