lib/hanami/action/exposable.rb in hanami-controller-0.7.0 vs lib/hanami/action/exposable.rb in hanami-controller-0.7.1
- old
+ new
@@ -1,5 +1,7 @@
+require 'hanami/action/exposable/guard'
+
module Hanami
module Action
# Exposures API
#
# @since 0.1.0
@@ -16,11 +18,13 @@
#
# @see http://www.ruby-doc.org/core-2.1.2/Module.html#method-i-included
def self.included(base)
base.class_eval do
extend ClassMethods
- expose :params
+ include Guard
+
+ _expose :params
end
end
# Exposures API class methods
#
@@ -65,9 +69,13 @@
end
exposures.push(*names)
end
end
+
+ # Alias of #expose to be used in internal modules.
+ # #_expose is not watched by the Guard
+ alias _expose expose
# Set of exposures attribute names
#
# @return [Array] the exposures attribute names
#