Class: Desmoservice::LigatureEdit

Inherits:
Object
  • Object
show all
Defined in:
lib/edition.rb

Instance Method Summary collapse

Constructor Details

#initialize(xml) ⇒ LigatureEdit

Returns a new instance of LigatureEdit.



108
109
110
# File 'lib/edition.rb', line 108

def initialize(xml)
  @xml = xml
end

Instance Method Details

#attr(attr_key, values) ⇒ Object



135
136
137
# File 'lib/edition.rb', line 135

def attr(attr_key, values)
  Edition.attr(@xml, attr_key, values)
end

#family(family_arg) ⇒ Object



127
128
129
# File 'lib/edition.rb', line 127

def family(family_arg)
  Edition.family(@xml, family_arg)
end

#key_prefix(key_prefix_arg) ⇒ Object



139
140
141
# File 'lib/edition.rb', line 139

def key_prefix(key_prefix_arg)
  Edition.key_prefix(@xml, key_prefix_arg)
end

#superior(superior_arg, context_arg = nil) ⇒ Object



112
113
114
115
116
117
118
119
120
121
122
123
124
125
# File 'lib/edition.rb', line 112

def superior(superior_arg, context_arg=nil)
  @xml << '<pere'
  Edition.to_attribute(@xml, superior_arg)
  if not context_arg.nil?
    if context_arg.is_a? Integer
      @xml << ' contexte="' << context_arg.to_s << '"'
    else
      index = context_arg.index('/')
      @xml << ' contexte-grille="' << context_arg[0,index] << '"'
      @xml << ' contexte-idctxt="' << context_arg[index+1..-1] << '"'
    end
  end
  @xml << '/>'
end

#text(lang, content) ⇒ Object



131
132
133
# File 'lib/edition.rb', line 131

def text(lang, content)
  Edition.text(@xml, lang, content)
end