Class: TargetDoc

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeTargetDoc

Returns a new instance of TargetDoc.



7
8
9
10
11
# File 'lib/ruby_make_script/doc.rb', line 7

def initialize()
    @arglist = []
    @descr = ""
    @name = ""
end

Instance Attribute Details

#arglistObject

Returns the value of attribute arglist.



3
4
5
# File 'lib/ruby_make_script/doc.rb', line 3

def arglist
  @arglist
end

#descrObject

Returns the value of attribute descr.



4
5
6
# File 'lib/ruby_make_script/doc.rb', line 4

def descr
  @descr
end

#nameObject

Returns the value of attribute name.



5
6
7
# File 'lib/ruby_make_script/doc.rb', line 5

def name
  @name
end

Instance Method Details

#add_arg(name, doc) ⇒ Object



16
17
18
# File 'lib/ruby_make_script/doc.rb', line 16

def add_arg(name, doc)
    @arglist += [[name, doc]]
end

#add_descr(str) ⇒ Object



20
21
22
# File 'lib/ruby_make_script/doc.rb', line 20

def add_descr(str)
    @descr += str + "\n"
end

#empty?Boolean

Returns:

  • (Boolean)


24
25
26
# File 'lib/ruby_make_script/doc.rb', line 24

def empty?()
    @arglist == [] || @descr == ""
end

#form_strObject



28
29
30
# File 'lib/ruby_make_script/doc.rb', line 28

def form_str()
    [@name, *@arglist].join(" ")
end

#set_name(name) ⇒ Object



12
13
14
# File 'lib/ruby_make_script/doc.rb', line 12

def set_name(name)
    @name = name
end