Module: WeChat::Menu
Defined Under Namespace
Modules: ClassMethods
Instance Method Summary collapse
Methods included from Entity::Base
#delete_from_we_chat, #get_we_chat_id_from_data, #reset_we_chat_id, #set_we_chat_id, #submit_to_we_chat, #submitted_to_we_chat?, #update_to_we_chat
Instance Method Details
#children_to_we_chat_data ⇒ Object
24 25 26 |
# File 'lib/we_chat/menu.rb', line 24 def children_to_we_chat_data self.children.inject([]) {|list, item| list << item.to_we_chat_data} end |
#to_we_chat_data ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/we_chat/menu.rb', line 8 def to_we_chat_data result = {} result[:name] = self.name if self.top_node? result[:sub_button] = children_to_we_chat_data else result[:type] = self. if self.view? result[:url] = self. else result[:key] = self. end end result end |