Class: Seatbelt::GateConfig

Inherits:
Object
  • Object
show all
Defined in:
lib/seatbelt/gate_config.rb

Overview

Public: A configuration class to configure the Gate.

Class Method Summary collapse

Class Method Details

.method_directive_classObject

Public: Getter to retrieve te class method directive.

Returns the class method directive if set otherwise ‘.’



41
42
43
# File 'lib/seatbelt/gate_config.rb', line 41

def self.method_directive_class
  @method_directive_class || "."
end

.method_directive_class=(directive) ⇒ Object

Public: Setter to set the class method directive. This is optional and defaults to .

is not allowed as directive.

directive - A String representing the directive.



26
27
28
29
# File 'lib/seatbelt/gate_config.rb', line 26

def self.method_directive_class=(directive)
  Seatbelt.check_directive(directive)
  @method_directive_class = directive
end

.method_directive_instanceObject

Public: Getter to retrieve te instance method directive.

Returns the instance method directive if set otherwise ‘#’



34
35
36
# File 'lib/seatbelt/gate_config.rb', line 34

def self.method_directive_instance
  @method_directive_instance || "#"
end

.method_directive_instance=(directive) ⇒ Object

Public: Setter to set the instance method directive. This is optional and defaults to #

is not allowed as directive.

directive - A String representing the directive.



14
15
16
17
# File 'lib/seatbelt/gate_config.rb', line 14

def self.method_directive_instance=(directive)
  Seatbelt.check_directive(directive)
  @method_directive_instance = directive
end

.method_directivesObject

Public: Hash of method directives attached to its scope.

Contains :class and :instance keys and their corrosponding method directives

Returns a Hash.



51
52
53
54
55
56
# File 'lib/seatbelt/gate_config.rb', line 51

def self.method_directives
  {
    :class    => self.method_directive_class,
    :instance => self.method_directive_instance
  }
end