Module: WheelOfWisdom
- Defined in:
- lib/wheel_of_wisdom/app.rb,
lib/wheel_of_wisdom/lexicon.rb,
lib/wheel_of_wisdom/version.rb
Overview
WheelOfWisdom
Defined Under Namespace
Classes: Clause, Phrase, PrepositionalPhrase, Sentence
Constant Summary collapse
- Adjectives =
%w[ abstract efficient idempotent idiomatic immature immutable lexicographic mature modular pedagogical relevant significant ].freeze
- Adverbs =
%w[ incremental marginal nominal pragmatic statistical ].freeze
- Articles =
%w[ that the ].freeze
- Nouns =
%w[ API abstraction application contract cookbook dashboard data debt deployment friction function idiom implementation integration interface JIRA library metrics model pipeline recipe repository semantics service spike sprint story subtask ].freeze
- Verbs =
%w[ automate capture compose containerize converge decompose defer deploy distribute document implement increment instantiate integrate mature model mutate parameterize reify refactor scale stabilize templatize wikify ].freeze
- Prefaces =
[ 'As I\'ve said many times', 'As a meta-comment', 'Good idea', 'Grr', 'Hmm', 'Hold on', 'I have an idea', 'Once again', '*Sigh*' ].freeze
- Prefixes =
[ 'I propose we', 'kindly', 'let\'s', 'please', 'we need to', 'we should' ].freeze
- Suffixes =
%w[ ].freeze
- VERSION =
'1.0.4'.freeze
Class Method Summary collapse
-
.random_element(list) ⇒ String
Randomly select an element from the list.
-
.spin ⇒ String
Spin for wisdom.
Class Method Details
.random_element(list) ⇒ String
Randomly select an element from the list
21 22 23 |
# File 'lib/wheel_of_wisdom/app.rb', line 21 def self.random_element(list) list[(list.length * rand).to_i] end |
.spin ⇒ String
Spin for wisdom
7 8 9 10 11 12 13 14 15 |
# File 'lib/wheel_of_wisdom/app.rb', line 7 def self.spin adjective = random_element(WheelOfWisdom::Adjectives) article = random_element(WheelOfWisdom::Articles) noun = random_element(WheelOfWisdom::Nouns) preface = random_element(WheelOfWisdom::Prefaces) prefix = random_element(WheelOfWisdom::Prefixes) verb = random_element(WheelOfWisdom::Verbs) "#{preface}, #{prefix} #{verb} #{article} #{adjective} #{noun}" end |