Class: Spectre::Spec
Instance Attribute Summary collapse
-
#block ⇒ Object
readonly
Returns the value of attribute block.
-
#context ⇒ Object
readonly
Returns the value of attribute context.
-
#data ⇒ Object
readonly
Returns the value of attribute data.
-
#desc ⇒ Object
readonly
Returns the value of attribute desc.
-
#file ⇒ Object
readonly
Returns the value of attribute file.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#line ⇒ Object
readonly
Returns the value of attribute line.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#subject ⇒ Object
readonly
Returns the value of attribute subject.
-
#tags ⇒ Object
readonly
Returns the value of attribute tags.
Instance Method Summary collapse
- #full_desc ⇒ Object
-
#initialize(name, subject, desc, tags, data, block, context, file, line) ⇒ Spec
constructor
A new instance of Spec.
- #to_h ⇒ Object
Constructor Details
#initialize(name, subject, desc, tags, data, block, context, file, line) ⇒ Spec
Returns a new instance of Spec.
104 105 106 107 108 109 110 111 112 113 114 |
# File 'lib/spectre.rb', line 104 def initialize name, subject, desc, , data, block, context, file, line @name = name @context = context @data = data @subject = subject @desc = desc @tags = @block = block @file = file @line = line end |
Instance Attribute Details
#block ⇒ Object (readonly)
Returns the value of attribute block.
102 103 104 |
# File 'lib/spectre.rb', line 102 def block @block end |
#context ⇒ Object (readonly)
Returns the value of attribute context.
102 103 104 |
# File 'lib/spectre.rb', line 102 def context @context end |
#data ⇒ Object (readonly)
Returns the value of attribute data.
102 103 104 |
# File 'lib/spectre.rb', line 102 def data @data end |
#desc ⇒ Object (readonly)
Returns the value of attribute desc.
102 103 104 |
# File 'lib/spectre.rb', line 102 def desc @desc end |
#file ⇒ Object (readonly)
Returns the value of attribute file.
102 103 104 |
# File 'lib/spectre.rb', line 102 def file @file end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
102 103 104 |
# File 'lib/spectre.rb', line 102 def id @id end |
#line ⇒ Object (readonly)
Returns the value of attribute line.
102 103 104 |
# File 'lib/spectre.rb', line 102 def line @line end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
102 103 104 |
# File 'lib/spectre.rb', line 102 def name @name end |
#subject ⇒ Object (readonly)
Returns the value of attribute subject.
102 103 104 |
# File 'lib/spectre.rb', line 102 def subject @subject end |
#tags ⇒ Object (readonly)
Returns the value of attribute tags.
102 103 104 |
# File 'lib/spectre.rb', line 102 def @tags end |
Instance Method Details
#full_desc ⇒ Object
116 117 118 |
# File 'lib/spectre.rb', line 116 def full_desc @subject.desc + ' ' + desc end |
#to_h ⇒ Object
120 121 122 123 124 125 126 127 128 129 130 131 |
# File 'lib/spectre.rb', line 120 def to_h { name: @name, context: @context.__desc, data: @data.map { |x| x.to_h }, subject: @subject.desc, desc: @desc, tags: @tags, file: @file, line: @line, } end |