Class: RubyApp::Elements::Mobile::Document
- Inherits:
-
RubyApp::Element
- Object
- RubyApp::Element
- RubyApp::Elements::Mobile::Document
- Defined in:
- lib/ruby_app/elements/mobile/document.rb
Direct Known Subclasses
RubyApp::Elements::Mobile::Default::Features::DocumentDocument, RubyApp::Elements::Mobile::Documents::Authentication::AuthenticationDocument, RubyApp::Elements::Mobile::Documents::MailDocument, RubyApp::Elements::Mobile::Documents::QuitDocument, Platforms::Ios::Document
Defined Under Namespace
Classes: LoadedEvent
Instance Attribute Summary collapse
-
#links ⇒ Object
readonly
Returns the value of attribute links.
-
#metadata ⇒ Object
readonly
Returns the value of attribute metadata.
-
#pages ⇒ Object
readonly
Returns the value of attribute pages.
-
#scripts ⇒ Object
readonly
Returns the value of attribute scripts.
-
#stylesheets ⇒ Object
readonly
Returns the value of attribute stylesheets.
Attributes inherited from RubyApp::Element
Instance Method Summary collapse
- #hide(event, url = RubyApp::Application.root) ⇒ Object
-
#initialize ⇒ Document
constructor
A new instance of Document.
- #page ⇒ Object
- #show(event, url = RubyApp::Application.root) ⇒ Object
Methods inherited from RubyApp::Element
Methods included from Mixins::ConfigurationMixin
Methods included from Mixins::TranslateMixin
Methods included from Mixins::TemplateMixin
#exclude_parent_template, #exclude_parent_template?, #get_cache, #get_default_template, #get_template, #get_template_name, #get_templates, #template_path
Methods included from Mixins::RenderMixin
#content_for, #get_cache, #get_default_template, #get_templates, #render
Constructor Details
#initialize ⇒ Document
Returns a new instance of Document.
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 |
# File 'lib/ruby_app/elements/mobile/document.rb', line 34 def initialize super @metadata = {} @links = {} @stylesheets = [] @scripts = [] @pages = [] @metadata.merge!('viewport' => 'width=device-width, initial-scale=1') @links.merge!('icon' => "#{RubyApp::Application.root_or_nil}/ruby_app/resources/elements/mobile/document/icon.ico") @stylesheets.push("#{RubyApp::Application.root_or_nil}/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/jquery.mobile-1.3.0.min.css") @scripts.push("#{RubyApp::Application.root_or_nil}/ruby_app/resources/elements/mobile/document/jquery-1.8.3.min.js") @scripts.push("#{RubyApp::Application.root_or_nil}/ruby_app/resources/elements/mobile/document/jquery-ui-1.9.2.custom/js/jquery-ui-1.9.2.custom.min.js") @scripts.push("#{RubyApp::Application.root_or_nil}/ruby_app/resources/elements/mobile/document/document.js") @scripts.push("#{RubyApp::Application.root_or_nil}/ruby_app/resources/elements/mobile/document/jquery.mobile-1.3.0/jquery.mobile-1.3.0.min.js") end |
Instance Attribute Details
#links ⇒ Object (readonly)
Returns the value of attribute links.
26 27 28 |
# File 'lib/ruby_app/elements/mobile/document.rb', line 26 def links @links end |
#metadata ⇒ Object (readonly)
Returns the value of attribute metadata.
25 26 27 |
# File 'lib/ruby_app/elements/mobile/document.rb', line 25 def @metadata end |
#pages ⇒ Object (readonly)
Returns the value of attribute pages.
30 31 32 |
# File 'lib/ruby_app/elements/mobile/document.rb', line 30 def pages @pages end |
#scripts ⇒ Object (readonly)
Returns the value of attribute scripts.
28 29 30 |
# File 'lib/ruby_app/elements/mobile/document.rb', line 28 def scripts @scripts end |
#stylesheets ⇒ Object (readonly)
Returns the value of attribute stylesheets.
27 28 29 |
# File 'lib/ruby_app/elements/mobile/document.rb', line 27 def stylesheets @stylesheets end |
Instance Method Details
#hide(event, url = RubyApp::Application.root) ⇒ Object
66 67 68 69 |
# File 'lib/ruby_app/elements/mobile/document.rb', line 66 def hide(event, url = RubyApp::Application.root) RubyApp::Session.documents.pop event.go(url) end |
#page ⇒ Object
57 58 59 |
# File 'lib/ruby_app/elements/mobile/document.rb', line 57 def page return @pages.last end |