Class: YmaParser::ResultType

Inherits:
Object
  • Object
show all
Defined in:
lib/yma_parser.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(type, xml) ⇒ ResultType

Returns a new instance of ResultType.



29
30
31
32
# File 'lib/yma_parser.rb', line 29

def initialize(type, xml)
  @type = type
  @xml = xml
end

Instance Attribute Details

#typeObject (readonly)

Returns the value of attribute type.



27
28
29
# File 'lib/yma_parser.rb', line 27

def type
  @type
end

#xmlObject (readonly)

Returns the value of attribute xml.



27
28
29
# File 'lib/yma_parser.rb', line 27

def xml
  @xml
end

Instance Method Details

#filtered_countObject



38
39
40
# File 'lib/yma_parser.rb', line 38

def filtered_count
  count(:filtered_count)
end

#total_countObject



34
35
36
# File 'lib/yma_parser.rb', line 34

def total_count
  count(:total_count)
end

#word_listObject



42
43
44
45
46
# File 'lib/yma_parser.rb', line 42

def word_list
  @xml.elements["word_list"].map do |wordtype|
    word_list = WordType.new(@type, wordtype)
  end
end