Class: IsoBibItem::IsoSubgroup

Inherits:
Object
  • Object
show all
Defined in:
lib/iso_bib_item/iso_project_group.rb

Overview

ISO subgroup.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name:, type: nil, number: nil) ⇒ IsoSubgroup

Returns a new instance of IsoSubgroup.

Parameters:

  • name (String)
  • type (String) (defaults to: nil)
  • number (Integer) (defaults to: nil)


65
66
67
68
69
# File 'lib/iso_bib_item/iso_project_group.rb', line 65

def initialize(name:, type: nil, number: nil)
  @name   = name
  @type   = type
  @number = number
end

Instance Attribute Details

#nameString (readonly)

Returns:

  • (String)


60
61
62
# File 'lib/iso_bib_item/iso_project_group.rb', line 60

def name
  @name
end

#numberInteger (readonly)

Returns:

  • (Integer)


57
58
59
# File 'lib/iso_bib_item/iso_project_group.rb', line 57

def number
  @number
end

#typeString (readonly)

Returns:

  • (String)


54
55
56
# File 'lib/iso_bib_item/iso_project_group.rb', line 54

def type
  @type
end

Instance Method Details

#to_xml(builder) ⇒ Object

Parameters:

  • builder (Nokogiri::XML::Builder)


72
73
74
75
76
# File 'lib/iso_bib_item/iso_project_group.rb', line 72

def to_xml(builder)
  builder.parent[:number] = number if number
  builder.parent[:type] = type if type
  builder.text name
end