Class: XamplGenerator::Options

Inherits:
Object
  • Object
show all
Includes:
Xampl::XamplObject, Xampl::XamplWithDataContent, IndexAttributeAsChild, ResolveAsChild
Defined in:
lib/xamplr/xampl-generator.rb,
lib/xamplr/xampl-hand-generated.rb

Constant Summary collapse

@@tag =
"options"
@@ns =
"http://xampl.com/generator"
@@ns_tag =
"{http://xampl.com/generator}options"
@@module_name =
"XamplGenerator"
@@attributes =
[
]

Instance Attribute Summary

Attributes included from Xampl::XamplObject

#is_changed, #parents

Class Method Summary collapse

Instance Method Summary collapse

Methods included from ResolveAsChild

#add_resolve, #init_resolve_as_child, #new_resolve, #remove_resolve, #resolve_child, #resolve_child=

Methods included from IndexAttributeAsChild

#add_index_attribute, #ensure_index_attribute, #index_attribute_child, #index_attribute_child=, #init_index_attribute_as_child, #new_index_attribute, #remove_index_attribute

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::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| ... } ⇒ Options

Returns a new instance of Options.

Yields:

  • (_self)

Yield Parameters:



1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
# File 'lib/xamplr/xampl-hand-generated.rb', line 1195

def initialize
  super

  init_xampl_object
  init_data_content
  init_index_attribute_as_child
  init_resolve_as_child

  yield(self) if block_given?
  changed
end

Class Method Details

.module_nameObject



1226
1227
1228
# File 'lib/xamplr/xampl-hand-generated.rb', line 1226

def Options.module_name
  @@module_name
end

.nsObject



1218
1219
1220
# File 'lib/xamplr/xampl-hand-generated.rb', line 1218

def Options.ns
  @@ns
end

.ns_tagObject



1222
1223
1224
# File 'lib/xamplr/xampl-hand-generated.rb', line 1222

def Options.ns_tag
  @@ns_tag
end

.persisted?Boolean

Returns:

  • (Boolean)


1178
1179
1180
# File 'lib/xamplr/xampl-hand-generated.rb', line 1178

def Options.persisted?
  false
end

.tagObject



1214
1215
1216
# File 'lib/xamplr/xampl-hand-generated.rb', line 1214

def Options.tag
  @@tag
end

Instance Method Details

#after_visit(visitor) ⇒ Object



1262
1263
1264
# File 'lib/xamplr/xampl-hand-generated.rb', line 1262

def after_visit(visitor)
  visitor.after_visit_options(self)
end

#append_to(other) ⇒ Object



1210
1211
1212
# File 'lib/xamplr/xampl-hand-generated.rb', line 1210

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

#attributesObject



1246
1247
1248
# File 'lib/xamplr/xampl-hand-generated.rb', line 1246

def attributes
  @@attributes
end

#before_visit(visitor) ⇒ Object



1254
1255
1256
# File 'lib/xamplr/xampl-hand-generated.rb', line 1254

def before_visit(visitor)
  visitor.before_visit_options(self)
end

#clear_non_persistent_index_attributesObject



1207
1208
# File 'lib/xamplr/xampl-hand-generated.rb', line 1207

def clear_non_persistent_index_attributes
end

#module_nameObject



1242
1243
1244
# File 'lib/xamplr/xampl-hand-generated.rb', line 1242

def module_name
  @@module_name
end

#nsObject



1234
1235
1236
# File 'lib/xamplr/xampl-hand-generated.rb', line 1234

def ns
  @@ns
end

#ns_tagObject



1238
1239
1240
# File 'lib/xamplr/xampl-hand-generated.rb', line 1238

def ns_tag
  @@ns_tag
end

#persisted?Boolean

Returns:

  • (Boolean)


1182
1183
1184
# File 'lib/xamplr/xampl-hand-generated.rb', line 1182

def persisted?
  false
end

#resolve(namespace, pkg = "XamplAdHoc", preferred_prefix = nil) ⇒ Object



391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
# File 'lib/xamplr/xampl-generator.rb', line 391

def resolve(namespace, pkg="XamplAdHoc", preferred_prefix=nil)
  if (namespace.kind_of?(Array)) then
    namespace.each do |ns, prefix|
      self.new_resolve do |resolver|
        resolver.pkg = pkg
        resolver.namespace = ns
        resolver.preferred_prefix = prefix
      end
    end
  else
    self.new_resolve do |resolver|
      resolver.pkg = pkg
      resolver.namespace = namespace
      resolver.preferred_prefix = preferred_prefix
    end
  end
end

#substitute_in_visit(visitor) ⇒ Object



1250
1251
1252
# File 'lib/xamplr/xampl-hand-generated.rb', line 1250

def substitute_in_visit(visitor)
  return visitor.substitute_in_visit_options(self) || self
end

#tagObject



1230
1231
1232
# File 'lib/xamplr/xampl-hand-generated.rb', line 1230

def tag
  @@tag
end

#visit(visitor) ⇒ Object



1258
1259
1260
# File 'lib/xamplr/xampl-hand-generated.rb', line 1258

def visit(visitor)
  visitor.visit_options(self)
end