Class: RubyApp::Element

Inherits:
Object show all
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

Defined Under Namespace

Classes: AssertedEvent, Event, ExceptionEvent, ExecutedEvent, MessagedEvent, TriggeredEvent, UpdatedEvent

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Mixins::ConfigurationMixin

configuration

Methods included from Mixins::TranslateMixin

localize, translate

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

#initializeElement

Returns a new instance of Element.



381
382
383
# File 'lib/ruby_app/element.rb', line 381

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

Instance Attribute Details

#attributesObject (readonly)

Returns the value of attribute attributes.



373
374
375
# File 'lib/ruby_app/element.rb', line 373

def attributes
  @attributes
end

Class Method Details

.get_element(element_id) ⇒ Object



389
390
391
392
# File 'lib/ruby_app/element.rb', line 389

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

Instance Method Details

#element_idObject



385
386
387
# File 'lib/ruby_app/element.rb', line 385

def element_id
  return "id_#{object_id}"
end