lib/ruby_speech/grxml/item.rb in ruby_speech-1.0.0 vs lib/ruby_speech/grxml/item.rb in ruby_speech-1.0.1

- old
+ new

@@ -50,11 +50,11 @@ # # @param [Numeric] w # def weight=(w) raise ArgumentError, "A Item's weight attribute must be a positive floating point number" unless w.to_s.match(/[^0-9\.]/) == nil and w.to_f >= 0 - write_attr :weight, w + self[:weight] = w end ## # # The repeat attribute @@ -97,11 +97,11 @@ else # verify range m,n is valid m, n = r.split('-').map &:to_i m < 0 || n < m end end - write_attr :repeat, r + self[:repeat] = r end ## # # The optional repeat-prob attribute @@ -115,10 +115,10 @@ ## # @param [Numeric] ia # def repeat_prob=(rp) raise ArgumentError, "A Item's repeat probablity attribute must be a floating point number between 0.0 and 1.0" unless rp.to_s.match(/[^0-9\.]/) == nil and rp.to_f >= 0 and rp.to_f <= 1.0 - write_attr :'repeat-prob', rp + self['repeat-prob'] = rp end def <<(arg) raise InvalidChildError, "A Item can only accept String, Ruleref, Tag or Token as children" unless VALID_CHILD_TYPES.include? arg.class super