Class: RubyApp::Element

Inherits:
Object
  • Object
show all
Extended by:
Haml::Helpers, Mixins::ConfigureMixin, Mixins::RenderMixin, Mixins::TemplateMixin, Mixins::TranslateMixin
Includes:
Haml::Helpers, Mixins::ConfigureMixin, Mixins::RenderMixin, Mixins::TranslateMixin
Defined in:
lib/ruby_app/element.rb

Defined Under Namespace

Classes: Event, ExceptionEvent

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Mixins::ConfigureMixin

configure

Methods included from Mixins::TranslateMixin

localize, translate

Methods included from Mixins::TemplateMixin

exclude_parent_template, exclude_parent_template?, get_templates, template_name, template_path

Methods included from Mixins::RenderMixin

clear_content_for, content_for, render, rendered?

Constructor Details

#initializeElement

Returns a new instance of Element.



131
132
133
# File 'lib/ruby_app/element.rb', line 131

def initialize
  @attributes = {:id => self.element_id}
end

Instance Attribute Details

#attributesObject (readonly)

Returns the value of attribute attributes.



127
128
129
# File 'lib/ruby_app/element.rb', line 127

def attributes
  @attributes
end

Class Method Details

.get_element(element_id) ⇒ Object



139
140
141
142
# File 'lib/ruby_app/element.rb', line 139

def self.get_element(element_id)
  element_id =~ /(\d+)/
  ObjectSpace._id2ref($1.to_i)
end

Instance Method Details

#element_idObject



135
136
137
# File 'lib/ruby_app/element.rb', line 135

def element_id
  "id_#{object_id}"
end