Class: RDoc::Fortran95parser::Fortran95Definition

Inherits:
Object
  • Object
show all
Defined in:
lib/rdoc/parsers/parse_f95.rb

Overview

Information of arguments of subroutines and functions in Fortran95

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(varname, types, inivalue, arraysuffix, comment, nodoc = false) ⇒ Fortran95Definition

Returns a new instance of Fortran95Definition.



1671
1672
1673
1674
1675
1676
1677
1678
1679
# File 'lib/rdoc/parsers/parse_f95.rb', line 1671

def initialize(varname, types, inivalue, arraysuffix, comment,
               nodoc=false)
  @varname = varname
  @types = types
  @inivalue = inivalue
  @arraysuffix = arraysuffix
  @comment = comment
  @nodoc = nodoc
end

Instance Attribute Details

#arraysuffixObject (readonly)

Suffix of array



1661
1662
1663
# File 'lib/rdoc/parsers/parse_f95.rb', line 1661

def arraysuffix
  @arraysuffix
end

#commentObject

Comments



1665
1666
1667
# File 'lib/rdoc/parsers/parse_f95.rb', line 1665

def comment
  @comment
end

#inivalueObject (readonly)

Initial Value



1657
1658
1659
# File 'lib/rdoc/parsers/parse_f95.rb', line 1657

def inivalue
  @inivalue
end

#nodocObject

Flag of non documentation



1669
1670
1671
# File 'lib/rdoc/parsers/parse_f95.rb', line 1669

def nodoc
  @nodoc
end

#typesObject (readonly)

Types of variable



1653
1654
1655
# File 'lib/rdoc/parsers/parse_f95.rb', line 1653

def types
  @types
end

#varnameObject (readonly)

Name of variable



1649
1650
1651
# File 'lib/rdoc/parsers/parse_f95.rb', line 1649

def varname
  @varname
end

Instance Method Details

#include_attr?(attr) ⇒ Boolean

If attr is included, true is returned

Returns:

  • (Boolean)


1695
1696
1697
1698
1699
1700
1701
# File 'lib/rdoc/parsers/parse_f95.rb', line 1695

def include_attr?(attr)
  return if !attr
  @types.split(",").each{ |type|
    return true if type.strip.chomp.upcase == attr.strip.chomp.upcase
  }
  return nil
end

#to_sObject



1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
# File 'lib/rdoc/parsers/parse_f95.rb', line 1681

def to_s
  return <<-EOF
<Fortran95Definition: 
  varname=#{@varname}, types=#{types},
  inivalue=#{@inivalue}, arraysuffix=#{@arraysuffix}, nodoc=#{@nodoc}, 
  comment=
#{@comment}
>
EOF
end