Module: NeverBounce::API::Feature::RequireAttr::InstanceMethods
- Defined in:
- lib/never_bounce/api/feature/require_attr.rb
Instance Method Summary collapse
-
#require_attr(name) ⇒ mixed
private
Require attribute to be set.
Instance Method Details
#require_attr(name) ⇒ mixed (private)
Require attribute to be set. Return attribute value.
20 21 22 23 24 |
# File 'lib/never_bounce/api/feature/require_attr.rb', line 20 def require_attr(name) send(name).tap do |_| raise AttributeError, "Attribute must be set: #{name}" if _.nil? end end |