Class: XamplExample::Thing

Inherits:
Object
  • Object
show all
Includes:
Xampl::XamplPersistedObject, Xampl::XamplWithDataContent, DescriptionAsChild, KeyValueAsChild, StuffAsChild, ThingAsChild, ThingsAsChild
Defined in:
lib/xamplr/handwritten/example.rb,
lib/xamplr/handwritten/hand-example.rb

Constant Summary collapse

@@tag =
"thing"
@@ns =
"http://xampl.com/example"
@@ns_tag =
"{http://xampl.com/example}thing"
@@module_name =
"XamplExample"
@@attributes =
[ [ :@pid, "pid" ] ]

Instance Attribute Summary collapse

Attributes included from ThingsAsChild

#things_child

Attributes included from ThingAsChild

#thing_child, #thing_map

Attributes included from StuffAsChild

#stuff_child

Attributes included from KeyValueAsChild

#key_value_child, #key_value_map

Attributes included from DescriptionAsChild

#description_child

Attributes included from Xampl::XamplPersistedObject

#load_needed, #persister

Attributes included from Xampl::XamplObject

#is_changed, #parents

Class Method Summary collapse

Instance Method Summary collapse

Methods included from ThingsAsChild

#add_things, #init_things_as_child, #new_things, #remove_things

Methods included from ThingAsChild

#add_thing, #init_thing_as_child, #new_thing, #remove_thing

Methods included from StuffAsChild

#add_stuff, #init_stuff_as_child, #new_stuff, #remove_stuff

Methods included from KeyValueAsChild

#add_key_value, #init_key_value_as_child, #new_key_value, #remove_key_value

Methods included from DescriptionAsChild

#add_description, #init_description_as_child, #new_description, #remove_description

Methods included from Xampl::XamplWithDataContent

#<<, #_content, #_content=, #add_content, #after_visit_by_element_kind, #before_visit_by_element_kind, #children, #has_mixed_content, #init_data_content, #test_to_xml, #test_to_xml_internal, #visit_by_element_kind

Methods included from Xampl::XamplPersistedObject

#accessed, #changed, #describe_yourself, #force_load, #init_xampl_object, #introduce_persister, #persist_required, #reset_contents

Methods included from Xampl::XamplObject

#===, #accessed, #add_parent, #changed, #changes_accepted, #compare_xampl, #copy_xampl, from_ruby, from_string, from_xml_file, from_xml_string, #ignore_when_no_index, #init_attributes, #init_hook, #init_xampl_object, #invalid, #invalidate, lookup_preferred_ns_prefix, #mark_changed_deep, #note_add_child, #note_add_to_parent, #note_adding_text_content, #note_attributes_initialised, #note_closed, #note_created, #note_initialise_attributes_with, #note_invalidate, #note_replacing, ns_preferred_prefix, #persist, #persist_required, #pp_xml, realise_from_xml_string, recover_from_string, #to_ruby, #to_xml

Constructor Details

#initialize {|_self| ... } ⇒ Thing

Returns a new instance of Thing.

Yields:

  • (_self)

Yield Parameters:



331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
# File 'lib/xamplr/handwritten/example.rb', line 331

def initialize
  super
  init_xampl_object

  @pid = nil if not defined? @pid

  init_data_content

  init_description_as_child
  init_key_value_as_child
  init_stuff_as_child
  init_thing_as_child
  init_things_as_child

  yield(self) if block_given?
  changed
end

Instance Attribute Details

#pidObject

Returns the value of attribute pid.



306
307
308
# File 'lib/xamplr/handwritten/example.rb', line 306

def pid
  @pid
end

Class Method Details

.module_nameObject



320
321
322
# File 'lib/xamplr/handwritten/example.rb', line 320

def Thing.module_name
  @@module_name
end

.nsObject



312
313
314
# File 'lib/xamplr/handwritten/example.rb', line 312

def Thing.ns
  @@ns
end

.ns_tagObject



316
317
318
# File 'lib/xamplr/handwritten/example.rb', line 316

def Thing.ns_tag
  @@ns_tag
end

.tagObject



308
309
310
# File 'lib/xamplr/handwritten/example.rb', line 308

def Thing.tag
  @@tag
end

Instance Method Details

#append_to(other) ⇒ Object



349
350
351
# File 'lib/xamplr/handwritten/example.rb', line 349

def append_to(other)
  other.add_thing(self)
end

#attributesObject



369
370
371
# File 'lib/xamplr/handwritten/example.rb', line 369

def attributes
  @@attributes
end

#get_the_indexObject



373
374
375
# File 'lib/xamplr/handwritten/example.rb', line 373

def get_the_index
  @pid
end

#module_nameObject



365
366
367
# File 'lib/xamplr/handwritten/example.rb', line 365

def module_name
  @@module_name
end

#nsObject



357
358
359
# File 'lib/xamplr/handwritten/example.rb', line 357

def ns
  @@ns
end

#ns_tagObject



361
362
363
# File 'lib/xamplr/handwritten/example.rb', line 361

def ns_tag
  @@ns_tag
end

#set_the_index(index) ⇒ Object



377
378
379
# File 'lib/xamplr/handwritten/example.rb', line 377

def set_the_index(index)
  @pid = index
end

#tagObject



353
354
355
# File 'lib/xamplr/handwritten/example.rb', line 353

def tag
  @@tag
end