Module: HumanAttributes
- Extended by:
- HumanAttributes
- Included in:
- HumanAttributes
- Defined in:
- lib/human_attributes.rb,
lib/human_attributes/config.rb,
lib/human_attributes/engine.rb,
lib/human_attributes/errors.rb,
lib/human_attributes/version.rb,
lib/human_attributes/method_builder.rb,
lib/human_attributes/formatters/base.rb,
lib/human_attributes/formatters/date.rb,
lib/human_attributes/formatters/custom.rb,
lib/human_attributes/formatters/boolean.rb,
lib/human_attributes/formatters/numeric.rb,
lib/human_attributes/formatters_builder.rb,
lib/human_attributes/formatters/enumerize.rb,
lib/human_attributes/active_record_extension.rb
Defined Under Namespace
Modules: ActiveRecordExtension, Config, Error, Formatters Classes: Engine, FormattersBuilder, MethodBuilder
Constant Summary collapse
- VERSION =
"0.1.0"
Instance Method Summary collapse
-
#setup {|_self| ... } ⇒ Object
You can add, in this module, your own configuration options as in the example below…
Instance Method Details
#setup {|_self| ... } ⇒ Object
You can add, in this module, your own configuration options as in the example below…
attr_writer :my_option
def my_option
return "Default Value" unless @my_option
@my_option
end
Then, you can customize the default behaviour (typically in a Rails initializer) like this:
HumanAttributes.setup do |config|
config.root_url = "Another value"
end
22 23 24 25 |
# File 'lib/human_attributes.rb', line 22 def setup yield self require "human_attributes" end |