Class: Preflight::Issue

Inherits:
Object
  • Object
show all
Defined in:
lib/preflight/issue.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(description, rule, attributes = {}) ⇒ Issue

Returns a new instance of Issue.



8
9
10
11
12
13
14
15
16
17
18
# File 'lib/preflight/issue.rb', line 8

def initialize(description, rule, attributes = {})
  @description = description
  if rule.is_a?(Class)
    @rule = rule.to_s.to_sym
  else
    @rule        = rule.class.to_s.to_sym
  end
  @attributes  = attributes || {}

  attach_attributes
end

Instance Attribute Details

#attributesObject (readonly)

Returns the value of attribute attributes.



6
7
8
# File 'lib/preflight/issue.rb', line 6

def attributes
  @attributes
end

#descriptionObject (readonly)

Returns the value of attribute description.



6
7
8
# File 'lib/preflight/issue.rb', line 6

def description
  @description
end

#ruleObject (readonly)

Returns the value of attribute rule.



6
7
8
# File 'lib/preflight/issue.rb', line 6

def rule
  @rule
end

Instance Method Details

#to_sObject



20
21
22
# File 'lib/preflight/issue.rb', line 20

def to_s
  @description
end