Class: Ecfr::VersionerService::Ancestors::MetadataNodeInfo

Inherits:
Object
  • Object
show all
Includes:
AttributeMethodDefinition
Defined in:
lib/ecfr/versioner_service/ancestors/metadata_node_info.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from AttributeMethodDefinition

included, #initialize

Instance Attribute Details

#hierarchyEcfr::Common::Hierarchy (readonly)

the heirarchy this node resides in



7
8
9
# File 'lib/ecfr/versioner_service/ancestors/metadata_node_info.rb', line 7

attribute :hierarchy,
type: Ecfr::Common::Hierarchy,
desc: "the heirarchy this node resides in"

#labelString (readonly)

the display value of the hierarchy

Returns:

  • (String)


11
12
# File 'lib/ecfr/versioner_service/ancestors/metadata_node_info.rb', line 11

attribute :label,
desc: "the display value of the hierarchy"

Instance Method Details

#present?Boolean

currently the API returns null for each key in the object so we need to do an attribute check

Returns:

  • (Boolean)


16
17
18
# File 'lib/ecfr/versioner_service/ancestors/metadata_node_info.rb', line 16

def present?
  @attributes.compact.present?
end