module Parakeet::Guideline
Public Instance Methods
controller_actions()
click to toggle source
# File lib/parakeet/guideline.rb, line 25 def controller_actions @controller_actions ||= Hash.new{ |hash, key| hash[key] = [] } end
verify_params(controller_action, parameter, type, validations)
click to toggle source
This seems like a super duplicative way to do this. Can pass in object that contains controller/action and ActionController and all parameters/types/validations instead. Is that just as messy? TODO: Update with a DRYer solution considering multiple parameters for a controller action
# File lib/parakeet/guideline.rb, line 18 def verify_params(controller_action, parameter, type, validations) # TODO: I'm thinking that this should create an object that represents # an action. Then into that object insert the individual parameter rules. # controller_actions[controller_action] = [] if controller_actions[controller_action].nil? controller_actions[controller_action] << Parameter.new(parameter, type, validations) end