Class: Construqt::Flavour::Ciscian::MultiValueVerb

Inherits:
Object
  • Object
show all
Defined in:
lib/construqt/flavour/ciscian/ciscian.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(section) ⇒ MultiValueVerb

Returns a new instance of MultiValueVerb.



261
262
263
264
# File 'lib/construqt/flavour/ciscian/ciscian.rb', line 261

def initialize(section)
  self.section=section
  self.values = []
end

Instance Attribute Details

#sectionObject

Returns the value of attribute section.



260
261
262
# File 'lib/construqt/flavour/ciscian/ciscian.rb', line 260

def section
  @section
end

#valuesObject

Returns the value of attribute values.



260
261
262
# File 'lib/construqt/flavour/ciscian/ciscian.rb', line 260

def values
  @values
end

Class Method Details

.compare(nu, old) ⇒ Object



284
285
286
287
288
289
290
291
292
293
# File 'lib/construqt/flavour/ciscian/ciscian.rb', line 284

def self.compare(nu, old)
  return [nu] unless old
  return [old.no] unless nu
  throw "classes must match #{nu.class.name} != #{old.class.name}" unless nu.class == old.class
  if (nu.serialize==old.serialize)
    [nil]
  else
    [nu]
  end
end

Instance Method Details

#add(value) ⇒ Object



266
267
268
269
# File 'lib/construqt/flavour/ciscian/ciscian.rb', line 266

def add(value)
  self.values << value
  self
end

#noObject



271
272
273
274
# File 'lib/construqt/flavour/ciscian/ciscian.rb', line 271

def no
  @no="no "
  self
end

#serializeObject



276
277
278
279
280
281
282
# File 'lib/construqt/flavour/ciscian/ciscian.rb', line 276

def serialize
  if @no
    ["#{@no}#{section}"]
  else
    ["#{section} #{values.join(",")}"]
  end
end