class RoadForest::Authorization::GrantBuilder
Attributes
list[R]
Public Class Methods
new(cache)
click to toggle source
# File lib/roadforest/authorization/grant-builder.rb, line 4 def initialize(cache) @cache = cache @list = [] end
Public Instance Methods
add(name, params=nil)
click to toggle source
# File lib/roadforest/authorization/grant-builder.rb, line 10 def add(name, params=nil) canonical = if params.nil? [name] else [name, params.keys.sort.map do |key| [key, params[key]] end] end @list << @cache[canonical] end