Class: Boilerpipe::Labels::LabelAction
- Inherits:
-
Object
- Object
- Boilerpipe::Labels::LabelAction
- Defined in:
- lib/boilerpipe/labels/label_action.rb
Instance Attribute Summary collapse
-
#labels ⇒ Object
readonly
Returns the value of attribute labels.
Instance Method Summary collapse
- #add_to(text_block) ⇒ Object
-
#initialize(labels = []) ⇒ LabelAction
constructor
A new instance of LabelAction.
- #to_s ⇒ Object
Constructor Details
#initialize(labels = []) ⇒ LabelAction
Returns a new instance of LabelAction.
5 6 7 |
# File 'lib/boilerpipe/labels/label_action.rb', line 5 def initialize(labels = []) @labels = labels end |
Instance Attribute Details
#labels ⇒ Object (readonly)
Returns the value of attribute labels.
3 4 5 |
# File 'lib/boilerpipe/labels/label_action.rb', line 3 def labels @labels end |
Instance Method Details
#add_to(text_block) ⇒ Object
9 10 11 |
# File 'lib/boilerpipe/labels/label_action.rb', line 9 def add_to(text_block) text_block.add_labels(@labels) end |
#to_s ⇒ Object
13 14 15 |
# File 'lib/boilerpipe/labels/label_action.rb', line 13 def to_s @labels.join(',') end |