Class: DefMastership::LineModifierBase

Inherits:
Object
  • Object
show all
Defined in:
lib/defmastership/line_modifier_base.rb

Overview

Change references from temporary to definitive with multiple RefChangers

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeLineModifierBase

Returns a new instance of LineModifierBase.



9
10
11
12
# File 'lib/defmastership/line_modifier_base.rb', line 9

def initialize
  @config = {}
  @changes = []
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method_name, *args, &block) ⇒ Object



14
15
16
17
18
# File 'lib/defmastership/line_modifier_base.rb', line 14

def method_missing(method_name, *args, &block)
  return @config[method_name] if @config[method_name]

  super
end

Instance Attribute Details

#changesObject (readonly)

Returns the value of attribute changes.



7
8
9
# File 'lib/defmastership/line_modifier_base.rb', line 7

def changes
  @changes
end

#configObject (readonly)

Returns the value of attribute config.



7
8
9
# File 'lib/defmastership/line_modifier_base.rb', line 7

def config
  @config
end

Instance Method Details

#from_config(config) ⇒ Object



24
25
26
27
# File 'lib/defmastership/line_modifier_base.rb', line 24

def from_config(config)
  @config.merge!(config)
  self
end

#respond_to_missing?(method_name, *args) ⇒ Boolean

Returns:

  • (Boolean)


20
21
22
# File 'lib/defmastership/line_modifier_base.rb', line 20

def respond_to_missing?(method_name, *args)
  @config[method_name] || super
end