Class: PhpCop::Rule
- Inherits:
-
Object
- Object
- PhpCop::Rule
- Defined in:
- lib/phpcop/rule.rb
Overview
Object represent a rule in yaml configuration file
Instance Attribute Summary collapse
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#enabled ⇒ Object
readonly
Returns the value of attribute enabled.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#see ⇒ Object
readonly
Returns the value of attribute see.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(name, option = {}) ⇒ Rule
constructor
A new instance of Rule.
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
#description ⇒ Object (readonly)
Returns the value of attribute description.
7 8 9 |
# File 'lib/phpcop/rule.rb', line 7 def description @description end |
#enabled ⇒ Object (readonly)
Returns the value of attribute enabled.
7 8 9 |
# File 'lib/phpcop/rule.rb', line 7 def enabled @enabled end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
7 8 9 |
# File 'lib/phpcop/rule.rb', line 7 def name @name end |
#see ⇒ Object (readonly)
Returns the value of attribute see.
7 8 9 |
# File 'lib/phpcop/rule.rb', line 7 def see @see end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
7 8 9 |
# File 'lib/phpcop/rule.rb', line 7 def type @type end |