Module: AttributeHelper
- Included in:
- Wakame::Action, Wakame::InstanceCounter, Wakame::Packets::RequestBase, Wakame::Packets::ResponseBase, Wakame::StatusDB::Model, Wakame::Trigger
- Defined in:
- lib/wakame/util.rb
Defined Under Namespace
Modules: ClassMethods
Constant Summary collapse
- CLASS_TYPE_KEY =
:class_type
- PRIMITIVE_CLASSES =
[NilClass, TrueClass, FalseClass, Numeric, String, Symbol]
- CONVERT_CLASSES =
{Time => proc{|i| i.to_s } }
Instance Method Summary collapse
- #dump_attrs(root = nil, &blk) ⇒ Object
-
#retrieve_attr_attribute(&blk) ⇒ Object
thread_immutable_method :dump_attrs if self.kind_of?(ThreadImmutable) module_function :dump_attrs.
Instance Method Details
#dump_attrs(root = nil, &blk) ⇒ Object
299 300 301 302 303 304 305 |
# File 'lib/wakame/util.rb', line 299 def dump_attrs(root=nil, &blk) if root.nil? root = self end return dump_internal(root, &blk) end |
#retrieve_attr_attribute(&blk) ⇒ Object
thread_immutable_method :dump_attrs if self.kind_of?(ThreadImmutable) module_function :dump_attrs
309 310 311 312 313 |
# File 'lib/wakame/util.rb', line 309 def retrieve_attr_attribute(&blk) self.class.ancestors.each { |klass| blk.call(klass.attr_attributes) if klass.include?(AttributeHelper) } end |