Class: Ecfr::Common::Hierarchy

Inherits:
Object
  • Object
show all
Extended by:
Extensible
Includes:
AttributeMethodDefinition
Defined in:
lib/ecfr/common/hierarchy.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Extensible

inherited

Methods included from AttributeMethodDefinition

included, #initialize

Instance Attribute Details

#appendixString (readonly)

Appendix identifier

Returns:

  • (String)


23
24
# File 'lib/ecfr/common/hierarchy.rb', line 23

attribute :appendix,
desc: "Appendix identifier"

#chapterString (readonly)

Chapter indentifier

Returns:

  • (String)


11
12
# File 'lib/ecfr/common/hierarchy.rb', line 11

attribute :chapter,
desc: "Chapter indentifier"

#paragraphString (readonly)

Paragraph citation

Returns:

  • (String)


25
26
# File 'lib/ecfr/common/hierarchy.rb', line 25

attribute :paragraph,
desc: "Paragraph citation"

#partString (readonly)

Part identifier

Returns:

  • (String)


15
16
# File 'lib/ecfr/common/hierarchy.rb', line 15

attribute :part,
desc: "Part identifier"

#sectionString (readonly)

Section identifier

Returns:

  • (String)


21
22
# File 'lib/ecfr/common/hierarchy.rb', line 21

attribute :section,
desc: "Section identifier"

#subchapterString (readonly)

Subchapter identifier

Returns:

  • (String)


13
14
# File 'lib/ecfr/common/hierarchy.rb', line 13

attribute :subchapter,
desc: "Subchapter identifier"

#subject_groupString (readonly)

Subject group identifier

Returns:

  • (String)


19
20
# File 'lib/ecfr/common/hierarchy.rb', line 19

attribute :subject_group,
desc: "Subject group identifier"

#subpartString (readonly)

Subpart identifier

Returns:

  • (String)


17
18
# File 'lib/ecfr/common/hierarchy.rb', line 17

attribute :subpart,
desc: "Subpart identifier"

#subtitleString (readonly)

Subtitle identifier

Returns:

  • (String)


9
10
# File 'lib/ecfr/common/hierarchy.rb', line 9

attribute :subtitle,
desc: "Subtitle identifier"

#titleString (readonly)

Title number

Returns:

  • (String)


7
8
# File 'lib/ecfr/common/hierarchy.rb', line 7

attribute :title,
desc: "Title number"

Instance Method Details

#to_hashObject



28
29
30
31
32
# File 'lib/ecfr/common/hierarchy.rb', line 28

def to_hash
  @attributes.each_with_object({}) { |attr, hsh|
    hsh[attr[0]] = attr[1]
  }.compact.symbolize_keys
end