Class: Linguistics::Latin::Verb::TenseBlock
- Inherits:
-
Object
- Object
- Linguistics::Latin::Verb::TenseBlock
- Extended by:
- Forwardable
- Includes:
- Phonographia
- Defined in:
- lib/latinverb/tense_block.rb,
lib/latinverb/tense_block/vector_resolution_delegate.rb
Direct Known Subclasses
Defined Under Namespace
Classes: VectorResolutionDelegate
Instance Attribute Summary collapse
-
#meaning ⇒ Object
readonly
Returns the value of attribute meaning.
-
#results ⇒ Object
readonly
Returns the value of attribute results.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(r, opts = {}) ⇒ TenseBlock
constructor
A new instance of TenseBlock.
- #to_json(*a) ⇒ Object
- #to_s ⇒ Object
- #wordless? ⇒ Boolean
Constructor Details
#initialize(r, opts = {}) ⇒ TenseBlock
Returns a new instance of TenseBlock.
24 25 26 27 28 |
# File 'lib/latinverb/tense_block.rb', line 24 def initialize(r, opts={}) @results = Array(r).map{ |v| fix_macrons(v) } @meaning = opts[:meaning] || "" @resolver = VectorResolutionDelegate.new(@results) end |
Instance Attribute Details
#meaning ⇒ Object (readonly)
Returns the value of attribute meaning.
22 23 24 |
# File 'lib/latinverb/tense_block.rb', line 22 def meaning @meaning end |
#results ⇒ Object (readonly)
Returns the value of attribute results.
22 23 24 |
# File 'lib/latinverb/tense_block.rb', line 22 def results @results end |
Class Method Details
.json_create(o) ⇒ Object
45 46 47 |
# File 'lib/latinverb/tense_block.rb', line 45 def TenseBlock.json_create(o) new(o['data']) end |
Instance Method Details
#to_json(*a) ⇒ Object
38 39 40 41 42 43 |
# File 'lib/latinverb/tense_block.rb', line 38 def to_json(*a) { 'json_class' => self.class.name, 'data' => @results.map{|i| i.to_json} }.to_json(*a) end |
#to_s ⇒ Object
30 31 32 |
# File 'lib/latinverb/tense_block.rb', line 30 def to_s to_a.to_s end |
#wordless? ⇒ Boolean
34 35 36 |
# File 'lib/latinverb/tense_block.rb', line 34 def wordless? !@results.find{ |r| r =~ /\w/ } end |