Class Request::SetEarsPosition
In: lib/violet/request.rb
Parent: Base::Event
Event Action TtsMessage SetEarsPosition EventCollection Enumerable Query GET_EARS_POSITION Base Request dot/f_8.png

Methods

new   to_url  

Constants

MIN_POS = 0
MAX_POS = 16

Public Class methods

[Source]

     # File lib/violet/request.rb, line 114
114:     def initialize h
115:       @h = h.dup
116:       raise ArgumentError.new('at least :posright or :posleft must be set')             unless @h[:posleft] or @h[:posright]
117:       raise ArgumentError.new(":posright must be between #{MIN_POS} and #{MAX_POS}")    if @h[:posright] and not @h[:posright].to_i.between?(MIN_POS,MAX_POS)
118:       raise ArgumentError.new(":posleft  must be between #{MIN_POS} and #{MAX_POS}")    if @h[:posleft ] and not @h[:posleft ].to_i.between?(MIN_POS,MAX_POS)
119:     end

Public Instance methods

[Source]

     # File lib/violet/request.rb, line 122
122:     def to_url
123:       url = Array.new
124:       url << "posleft=#{h[:posleft].to_i}"   if h[:posleft]
125:       url << "posright=#{h[:posright].to_i}" if h[:posright]
126:       url.join('&')
127:     end

[Validate]