Module: CafeCar::OptionHelpers
- Extended by:
- ActiveSupport::Concern
- Included in:
- Presenter, Table::Builder
- Defined in:
- lib/cafe_car/option_helpers.rb
Instance Method Summary collapse
Instance Method Details
#assign_option!(k, default) ⇒ Object
16 17 18 19 |
# File 'lib/cafe_car/option_helpers.rb', line 16 def assign_option!(k, default) value = .delete(k) { default.respond_to?(:call) ? default.call : default.clone } instance_variable_set("@#{k}", value) end |
#assign_options! ⇒ Object
11 12 13 14 |
# File 'lib/cafe_car/option_helpers.rb', line 11 def raise "@options is not a hash" unless .is_a? Hash option_defaults.each { assign_option!(_1, _2) } end |
#get_options ⇒ Object
9 |
# File 'lib/cafe_car/option_helpers.rb', line 9 def = @options |