Class: Nukumber::Model::Feature
- Inherits:
-
Object
- Object
- Nukumber::Model::Feature
- Defined in:
- lib/nukumber/model/feature.rb
Instance Attribute Summary collapse
-
#background ⇒ Object
Returns the value of attribute background.
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#feature_elements ⇒ Object
Returns the value of attribute feature_elements.
-
#file_path ⇒ Object
readonly
Returns the value of attribute file_path.
-
#line ⇒ Object
readonly
Returns the value of attribute line.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#tags ⇒ Object
Returns the value of attribute tags.
Instance Method Summary collapse
-
#initialize(name, line, description, file_path) ⇒ Feature
constructor
A new instance of Feature.
- #keyword ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(name, line, description, file_path) ⇒ Feature
Returns a new instance of Feature.
9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/nukumber/model/feature.rb', line 9 def initialize(name, line, description, file_path) if name.length == 0 raise "Features must be named (#{file_path}:#{line})" elsif name[0,1] !~ /[a-zA-Z]/ raise "Feature names must begin with a letter (#{file_path}:#{line})" end @name, @line, @description = name, line, description @feature_elements, @tags = [], [] @background = nil @file_path = file_path end |
Instance Attribute Details
#background ⇒ Object
Returns the value of attribute background.
7 8 9 |
# File 'lib/nukumber/model/feature.rb', line 7 def background @background end |
#description ⇒ Object (readonly)
Returns the value of attribute description.
6 7 8 |
# File 'lib/nukumber/model/feature.rb', line 6 def description @description end |
#feature_elements ⇒ Object
Returns the value of attribute feature_elements.
7 8 9 |
# File 'lib/nukumber/model/feature.rb', line 7 def feature_elements @feature_elements end |
#file_path ⇒ Object (readonly)
Returns the value of attribute file_path.
6 7 8 |
# File 'lib/nukumber/model/feature.rb', line 6 def file_path @file_path end |
#line ⇒ Object (readonly)
Returns the value of attribute line.
6 7 8 |
# File 'lib/nukumber/model/feature.rb', line 6 def line @line end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
6 7 8 |
# File 'lib/nukumber/model/feature.rb', line 6 def name @name end |
#tags ⇒ Object
Returns the value of attribute tags.
7 8 9 |
# File 'lib/nukumber/model/feature.rb', line 7 def @tags end |
Instance Method Details
#keyword ⇒ Object
21 22 23 |
# File 'lib/nukumber/model/feature.rb', line 21 def keyword 'Feature' end |
#to_s ⇒ Object
25 26 27 |
# File 'lib/nukumber/model/feature.rb', line 25 def to_s "#{keyword} \"#{name}\"" end |