Class: RubyApp::Element
- Inherits:
-
Object
- Object
- RubyApp::Element
- Extended by:
- Haml::Helpers, Mixins::ConfigurationMixin, Mixins::RenderMixin, Mixins::TemplateMixin, Mixins::TranslateMixin
- Includes:
- Haml::Helpers, Mixins::ConfigurationMixin, Mixins::RenderMixin, Mixins::TranslateMixin
- Defined in:
- lib/ruby_app/element.rb
Direct Known Subclasses
RubyApp::Elements::Base::BaseDialog, RubyApp::Elements::Base::BaseMail, RubyApp::Elements::Base::BasePage, RubyApp::Elements::Calendars::Base::BaseMonth, RubyApp::Elements::Click, RubyApp::Elements::ExceptionElement, RubyApp::Elements::Input, RubyApp::Elements::List, RubyApp::Elements::Markdown, RubyApp::Elements::Navigation::Base::BaseBreadcrumbs, RubyApp::Elements::Navigation::PageLink
Defined Under Namespace
Classes: Event, ExceptionEvent
Instance Attribute Summary collapse
-
#attributes ⇒ Object
readonly
Returns the value of attribute attributes.
Class Method Summary collapse
Instance Method Summary collapse
- #element_id ⇒ Object
-
#initialize ⇒ Element
constructor
A new instance of Element.
Methods included from Mixins::ConfigurationMixin
Methods included from Mixins::TranslateMixin
Methods included from Mixins::TemplateMixin
exclude_parent_template, exclude_parent_template?, get_template, get_templates, template_name, template_path
Methods included from Mixins::RenderMixin
content_for, render, rendered?, templates
Constructor Details
#initialize ⇒ Element
Returns a new instance of Element.
137 138 139 |
# File 'lib/ruby_app/element.rb', line 137 def initialize @attributes = {:id => self.element_id} end |
Instance Attribute Details
#attributes ⇒ Object (readonly)
Returns the value of attribute attributes.
133 134 135 |
# File 'lib/ruby_app/element.rb', line 133 def attributes @attributes end |
Class Method Details
.get_content_type(format) ⇒ Object
145 146 147 |
# File 'lib/ruby_app/element.rb', line 145 def self.get_content_type(format) ( mime_type = MIME::Types.type_for(format)[0] ) ? mime_type.content_type : 'text/plain' end |
.get_element(element_id) ⇒ Object
149 150 151 152 |
# File 'lib/ruby_app/element.rb', line 149 def self.get_element(element_id) element_id =~ /(-?\d+)/ ObjectSpace._id2ref($1.to_i) end |
Instance Method Details
#element_id ⇒ Object
141 142 143 |
# File 'lib/ruby_app/element.rb', line 141 def element_id "id_#{object_id}" end |