Class: Boilerpipe::Labels::LabelAction

Inherits:
Object
  • Object
show all
Defined in:
lib/boilerpipe/labels/label_action.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#labelsObject (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_sObject



13
14
15
# File 'lib/boilerpipe/labels/label_action.rb', line 13

def to_s
  @labels.join(',')
end