class Desmoservice::Terms
Public Class Methods
new()
click to toggle source
# File lib/terms.rb, line 5 def initialize() @array = Array.new end
Public Instance Methods
[](index)
click to toggle source
# File lib/terms.rb, line 26 def [](index) return @array[index] end
each() { |v| ... }
click to toggle source
# File lib/terms.rb, line 16 def each @array.each do |v| yield(v) end end
length()
click to toggle source
# File lib/terms.rb, line 22 def length return @array.length end
parse_json(json_string)
click to toggle source
# File lib/terms.rb, line 9 def parse_json(json_string) data = JSON.parse(json_string) if data.has_key?('terms') data['terms'].each {|v| @array << Term.new(v)} end end