Class: Beats::Command::Sentence
- Defined in:
- lib/beats/commands/sentence.rb
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
Methods inherited from Base
Constructor Details
This class inherits a constructor from Beats::Command::Base
Instance Method Details
#sentence ⇒ Object
5 6 7 8 9 10 |
# File 'lib/beats/commands/sentence.rb', line 5 def sentence display(client.sentence['fields'].map { |field| option = field['options'][rand(field['options'].size)] [option['prefix'] || field['prefix'], "{#{option['name']}}", option['suffix'] || field['suffix']] }.flatten.compact.join(' ')) end |