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.



287
288
289
290
# File 'lib/construqt/flavour/ciscian/ciscian.rb', line 287

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

Instance Attribute Details

#sectionObject

Returns the value of attribute section.



286
287
288
# File 'lib/construqt/flavour/ciscian/ciscian.rb', line 286

def section
  @section
end

#valuesObject

Returns the value of attribute values.



286
287
288
# File 'lib/construqt/flavour/ciscian/ciscian.rb', line 286

def values
  @values
end

Class Method Details

.compare(nu, old) ⇒ Object



315
316
317
318
319
320
321
322
323
324
# File 'lib/construqt/flavour/ciscian/ciscian.rb', line 315

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



292
293
294
295
# File 'lib/construqt/flavour/ciscian/ciscian.rb', line 292

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

#noObject



297
298
299
300
# File 'lib/construqt/flavour/ciscian/ciscian.rb', line 297

def no
  @no="no "
  self
end

#serializeObject



307
308
309
310
311
312
313
# File 'lib/construqt/flavour/ciscian/ciscian.rb', line 307

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

#yesObject



302
303
304
305
# File 'lib/construqt/flavour/ciscian/ciscian.rb', line 302

def yes
  @no=nil
  self
end