class StrongConcerns::Intermediate
Attributes
options[RW]
Public Class Methods
new(subject, options)
click to toggle source
# File lib/strong_concerns/intermediate.rb, line 34 def initialize(subject, options) @__subject__ = subject @options = options @active = false end
prepare(mod)
click to toggle source
# File lib/strong_concerns/intermediate.rb, line 8 def self.prepare(mod) Class.new(Intermediate).tap do |kls| kls.send(:include, mod) meths = mod.require_methods kls.def_delegators :@__subject__, *meths end end
Public Instance Methods
activate()
click to toggle source
# File lib/strong_concerns/intermediate.rb, line 18 def activate @active = true end
active?()
click to toggle source
# File lib/strong_concerns/intermediate.rb, line 26 def active? @active end
inactivate()
click to toggle source
# File lib/strong_concerns/intermediate.rb, line 22 def inactivate @active = false end
inactive?()
click to toggle source
# File lib/strong_concerns/intermediate.rb, line 30 def inactive? not active? end
inspect()
click to toggle source
# File lib/strong_concerns/intermediate.rb, line 44 def inspect "Intermediate<#{self.methods}>" end
method_missing(meth)
click to toggle source
# File lib/strong_concerns/intermediate.rb, line 40 def method_missing(meth) raise NameError.new("Looks like you not list method <#{meth}> in self.require_methods of concern or misspelled it") end