class JsRoutes::Configuration
Public Class Methods
new(attributes = nil)
click to toggle source
# File lib/js_routes.rb, line 44 def initialize(attributes = nil) assign(DEFAULTS) return unless attributes assign(attributes) end
Public Instance Methods
[](attribute)
click to toggle source
# File lib/js_routes.rb, line 58 def [](attribute) send(attribute) end
assign(attributes)
click to toggle source
# File lib/js_routes.rb, line 50 def assign(attributes) attributes.each do |attribute, value| value = value.call if value.is_a?(Proc) send(:"#{attribute}=", value) end self end
merge(attributes)
click to toggle source
# File lib/js_routes.rb, line 62 def merge(attributes) clone.assign(attributes) end
to_hash()
click to toggle source
# File lib/js_routes.rb, line 66 def to_hash Hash[*members.zip(values).flatten(1)].symbolize_keys end