Module: Rails::Plugin::Configurable
- Defined in:
- lib/rails_ext/railties/plugin_configuration.rb
Defined Under Namespace
Classes: Config
Instance Attribute Summary collapse
-
#owner ⇒ Object
Returns the value of attribute owner.
Instance Method Summary collapse
- #destroy ⇒ Object
- #id ⇒ Object
- #option(name, default, type = :string) ⇒ Object
- #option_definitions ⇒ Object
- #options=(options) ⇒ Object
- #save! ⇒ Object
- #to_param ⇒ Object
Instance Attribute Details
#owner ⇒ Object
Returns the value of attribute owner.
14 15 16 |
# File 'lib/rails_ext/railties/plugin_configuration.rb', line 14 def owner @owner end |
Instance Method Details
#destroy ⇒ Object
42 43 44 45 |
# File 'lib/rails_ext/railties/plugin_configuration.rb', line 42 def destroy config.destroy @config = nil end |
#id ⇒ Object
30 31 32 |
# File 'lib/rails_ext/railties/plugin_configuration.rb', line 30 def id name end |
#option(name, default, type = :string) ⇒ Object
20 21 22 23 |
# File 'lib/rails_ext/railties/plugin_configuration.rb', line 20 def option(name, default, type = :string) define_option_accessors(name, default) option_definitions[name.to_sym] = { :default => default, :type => type } end |
#option_definitions ⇒ Object
16 17 18 |
# File 'lib/rails_ext/railties/plugin_configuration.rb', line 16 def option_definitions @option_definitions ||= {} end |
#options=(options) ⇒ Object
25 26 27 28 |
# File 'lib/rails_ext/railties/plugin_configuration.rb', line 25 def () # FIXME symbolize_keys and slice defined options config. = end |
#save! ⇒ Object
38 39 40 |
# File 'lib/rails_ext/railties/plugin_configuration.rb', line 38 def save! config.save! end |
#to_param ⇒ Object
34 35 36 |
# File 'lib/rails_ext/railties/plugin_configuration.rb', line 34 def to_param name end |