Class: RKit::Override::Pattern
Constant Summary collapse
- STANDARD_PATTERN =
-> *_ do ->(*args, &block){ __newdef__(*args, &block) } end
- DEPEND_PATTERN =
-> on: do -> *args, &block do if send(on).present? __newdef__(*args, &block) else nil end end end
- IF_PATTERN =
-> on: do -> *args, &block do if send(on).present? __newdef__(*args, &block) else __olddef__(*args, &block) end end end
Instance Attribute Summary collapse
-
#args ⇒ Object
Returns the value of attribute args.
-
#pattern ⇒ Object
Returns the value of attribute pattern.
Class Method Summary collapse
Instance Method Summary collapse
- #build ⇒ Object
-
#initialize(pattern, *args) ⇒ Pattern
constructor
A new instance of Pattern.
Constructor Details
#initialize(pattern, *args) ⇒ Pattern
10 11 12 13 |
# File 'lib/r_kit/override/pattern.rb', line 10 def initialize pattern, *args @pattern = pattern @args = args end |
Instance Attribute Details
#args ⇒ Object
Returns the value of attribute args.
8 9 10 |
# File 'lib/r_kit/override/pattern.rb', line 8 def args @args end |
#pattern ⇒ Object
Returns the value of attribute pattern.
8 9 10 |
# File 'lib/r_kit/override/pattern.rb', line 8 def pattern @pattern end |
Class Method Details
.build(*args) ⇒ Object
3 4 5 |
# File 'lib/r_kit/override/pattern.rb', line 3 def self.build *args new(*args).build end |
Instance Method Details
#build ⇒ Object
15 16 17 |
# File 'lib/r_kit/override/pattern.rb', line 15 def build send "build_from_#{ pattern.class.name.underscore }" end |