Class: Oulipo::Analysis
- Inherits:
-
Object
- Object
- Oulipo::Analysis
- Includes:
- Enumerable
- Defined in:
- lib/oulipo/analysis.rb
Instance Attribute Summary collapse
-
#deconstruction ⇒ Object
readonly
Returns the value of attribute deconstruction.
-
#original ⇒ Object
readonly
Returns the value of attribute original.
-
#word_lists ⇒ Object
readonly
Returns the value of attribute word_lists.
Instance Method Summary collapse
- #identified(type = nil) ⇒ Object
-
#initialize(text, options = {}) ⇒ Analysis
constructor
A new instance of Analysis.
Constructor Details
#initialize(text, options = {}) ⇒ Analysis
Returns a new instance of Analysis.
7 8 9 10 11 |
# File 'lib/oulipo/analysis.rb', line 7 def initialize(text, = {}) @word_lists = @original = text deconstruct! end |
Instance Attribute Details
#deconstruction ⇒ Object (readonly)
Returns the value of attribute deconstruction.
5 6 7 |
# File 'lib/oulipo/analysis.rb', line 5 def deconstruction @deconstruction end |
#original ⇒ Object (readonly)
Returns the value of attribute original.
5 6 7 |
# File 'lib/oulipo/analysis.rb', line 5 def original @original end |
#word_lists ⇒ Object (readonly)
Returns the value of attribute word_lists.
5 6 7 |
# File 'lib/oulipo/analysis.rb', line 5 def word_lists @word_lists end |
Instance Method Details
#identified(type = nil) ⇒ Object
13 14 15 16 17 |
# File 'lib/oulipo/analysis.rb', line 13 def identified(type = nil) result = identified_tuples result.select! { |tuple| tuple.last == type } if type result.map(&:first) end |