Class: PhpCop::Rule

Inherits:
Object
  • Object
show all
Defined in:
lib/phpcop/rule.rb

Overview

Object represent a rule in yaml configuration file

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, option = {}) ⇒ Rule

Returns a new instance of Rule.



9
10
11
12
13
14
15
16
# File 'lib/phpcop/rule.rb', line 9

def initialize(name, option = {})
  nt = name.split('/')
  @name = nt[1]
  @type = nt[0]
  @enabled = option['enabled']
  @description = option['description']
  @see = option['see']
end

Instance Attribute Details

#descriptionObject (readonly)

Returns the value of attribute description.



7
8
9
# File 'lib/phpcop/rule.rb', line 7

def description
  @description
end

#enabledObject (readonly)

Returns the value of attribute enabled.



7
8
9
# File 'lib/phpcop/rule.rb', line 7

def enabled
  @enabled
end

#nameObject (readonly)

Returns the value of attribute name.



7
8
9
# File 'lib/phpcop/rule.rb', line 7

def name
  @name
end

#seeObject (readonly)

Returns the value of attribute see.



7
8
9
# File 'lib/phpcop/rule.rb', line 7

def see
  @see
end

#typeObject (readonly)

Returns the value of attribute type.



7
8
9
# File 'lib/phpcop/rule.rb', line 7

def type
  @type
end