Class: Qreds::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/qreds/config.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(args) ⇒ Config

Returns a new instance of Config.

Parameters:

  • args (Hash<#to_s, any>)


10
11
12
13
14
# File 'lib/qreds/config.rb', line 10

def initialize(args)
  args.each do |(key, value)|
    send("#{key}=", value)
  end
end

Instance Attribute Details

#default_lambdaObject

Returns the value of attribute default_lambda.



5
6
7
# File 'lib/qreds/config.rb', line 5

def default_lambda
  @default_lambda
end

#functor_groupObject

Returns the value of attribute functor_group.



5
6
7
# File 'lib/qreds/config.rb', line 5

def functor_group
  @functor_group
end

#operator_mappingObject

Returns the value of attribute operator_mapping.



5
6
7
# File 'lib/qreds/config.rb', line 5

def operator_mapping
  @operator_mapping
end

Class Method Details

.define_reducer(helper_name, strategy: method(:define_endpoint_method)) {|config| ... } ⇒ Object

Parameters:

  • helper_name (Symbol|String)

    the name of the helper method to be defined

Yields:

  • (config)


21
22
23
24
25
26
27
# File 'lib/qreds/config.rb', line 21

def define_reducer(helper_name, strategy: method(:define_endpoint_method))
  config = new(functor_group: helper_name)

  yield config

  strategy.call(helper_name, config)
end