Top Level Namespace

Defined Under Namespace

Modules: SiriRootObject Classes: SiriAddViews, SiriAnswer, SiriAnswerLine, SiriAnswerSnippet, SiriAssistantUtteranceView, SiriButton, SiriCancelSnippetCommand, SiriConfirmSnippetCommand, SiriConfirmationOptions, SiriGetRequestOrigin, SiriLocation, SiriMapItem, SiriMapItemSnippet, SiriObject, SiriProxy, SiriRequestCompleted, SiriSendCommands, SiriSetRequestOrigin, SiriStartRequest, String

Instance Method Summary collapse

Instance Method Details

#add_property_to_class(klass, prop) ⇒ Object



58
59
60
61
62
63
64
65
66
# File 'lib/siri_objects.rb', line 58

def add_property_to_class(klass, prop)
  klass.send(:define_method, (prop.to_s + "=").to_sym) { |value|
    self.properties[prop.to_s] = value
  }
  
  klass.send(:define_method, prop.to_s.to_sym) {
    self.properties[prop.to_s]
  }
end

#generate_request_completed(ref_id, callbacks = nil) ⇒ Object



11
12
13
14
15
16
# File 'lib/siri_objects.rb', line 11

def generate_request_completed(ref_id, callbacks=nil)
  object = SiriRequestCompleted.new()
  object.callbacks = callbacks if callbacks != nil
  object.make_root(ref_id)
  return object.to_hash
end

#generate_siri_utterance(ref_id, text, speakableText = text, listenAfterSpeaking = false) ⇒ Object



4
5
6
7
8
9
# File 'lib/siri_objects.rb', line 4

def generate_siri_utterance(ref_id, text, speakableText=text, listenAfterSpeaking=false)
  object = SiriAddViews.new
  object.make_root(ref_id)
  object.views << SiriAssistantUtteranceView.new(text, speakableText, "Misc#ident", listenAfterSpeaking)
  return object.to_hash
end