class Maskara::Data
Public Class Methods
action_data(action, controller)
click to toggle source
# File lib/maskara/data.rb, line 31 def action_data(action, controller) controller_data(controller).fetch('actions', {}).fetch(action, {}) end
controller_data(controller)
click to toggle source
# File lib/maskara/data.rb, line 27 def controller_data(controller) controllers_data.fetch(controller, {}) end
controllers_data()
click to toggle source
# File lib/maskara/data.rb, line 23 def controllers_data data.fetch('controllers', {}) end
data()
click to toggle source
# File lib/maskara/data.rb, line 8 def data @data ||= load_data || {} end
data_file()
click to toggle source
# File lib/maskara/data.rb, line 4 def data_file Maskara.configuration.data_file end
load_data()
click to toggle source
# File lib/maskara/data.rb, line 12 def load_data begin return YAML.load(open(data_file).read) rescue Errno::ENOENT puts "Coundn't find Maskara data file at #{data_file}" rescue Psych::SyntaxError puts "Invalid YAML found in Maskara data file at #{data_file}" end {} end
skip_filters()
click to toggle source
# File lib/maskara/data.rb, line 35 def skip_filters controllers_data.collect do |controller, config| unless config['skip_filters'].blank? ["#{controller.classify}Controller".constantize, config['skip_filters'].map(&:to_sym)] end end.compact end