Class: Maven::Model::Activation

Inherits:
Tag
  • Object
show all
Defined in:
lib/maven/model/model.rb

Instance Method Summary collapse

Methods inherited from Tag

#_name, _tags, #comment, prepend_tags, tags, #to_xml

Constructor Details

#initializeActivation

Returns a new instance of Activation.



547
548
549
# File 'lib/maven/model/model.rb', line 547

def initialize
  super({})
end

Instance Method Details

#add_property(name, value) ⇒ Object



551
552
553
554
# File 'lib/maven/model/model.rb', line 551

def add_property(name, value)
  warn "deprecated, use 'property' instead"
  property(name, value)
end

#by_default(value = true) ⇒ Object



572
573
574
575
# File 'lib/maven/model/model.rb', line 572

def by_default(value = true)
  @activeByDefault = value
  self
end

#os(&block) ⇒ Object



566
567
568
569
570
# File 'lib/maven/model/model.rb', line 566

def os(&block)
  @os ||= OS.new
  block.call(@os) if block
  @os
end

#property(name, value) ⇒ Object



556
557
558
559
560
561
562
563
564
# File 'lib/maven/model/model.rb', line 556

def property(name, value)
  if name && value
    # TODO make more then one property
    raise "more then one property is not implemented: #{@property.name} => #{@property.value}" if @property
    @property ||= ListItems.new
    @property << Property.new(name, value)
  end
  self
end