Module: Model::Menu::ViewMenu
- Extended by:
- ActiveSupport::Concern
- Included in:
- Wechat::ViewMenu
- Defined in:
- app/models/wechat/model/menu/view_menu.rb
Instance Method Summary collapse
Instance Method Details
#as_json ⇒ Object
11 12 13 14 15 16 17 |
# File 'app/models/wechat/model/menu/view_menu.rb', line 11 def as_json { type: 'view', name: name, url: url } end |
#host ⇒ Object
26 27 28 29 30 31 32 33 |
# File 'app/models/wechat/model/menu/view_menu.rb', line 26 def host organ = app&.organ if organ organ.host else '' end end |
#url ⇒ Object
19 20 21 22 23 24 |
# File 'app/models/wechat/model/menu/view_menu.rb', line 19 def url ActionDispatch::Http::URL.url_for( host: value, protocol: Rails.application.routes.[:protocol] ) end |