Class: RubyApp::Element

Inherits:
Object
  • 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.



292
293
294
# File 'lib/ruby_app/element.rb', line 292

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

Instance Attribute Details

#attributesObject (readonly)

Returns the value of attribute attributes.



284
285
286
# File 'lib/ruby_app/element.rb', line 284

def attributes
  @attributes
end

Class Method Details

.get_element(element_id) ⇒ Object



300
301
302
303
# File 'lib/ruby_app/element.rb', line 300

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

Instance Method Details

#element_idObject



296
297
298
# File 'lib/ruby_app/element.rb', line 296

def element_id
  return "id_#{object_id}"
end