Class: Fields::Label

Inherits:
ContainerField show all
Defined in:
lib/hammer_cli/output/fields.rb

Instance Attribute Summary

Attributes inherited from Field

#label, #parent, #path, #sets

Instance Method Summary collapse

Methods inherited from ContainerField

#fields, #initialize, #output_definition

Methods inherited from Field

#full_label, #hide_blank?, #hide_missing?, #id, #initialize, #match_id?, #parameters

Constructor Details

This class inherits a constructor from Fields::ContainerField

Instance Method Details

#display?(value) ⇒ Boolean

Returns:



120
121
122
123
124
125
126
127
# File 'lib/hammer_cli/output/fields.rb', line 120

def display?(value)
  return false if value.is_a?(HammerCLI::Output::DataMissing) && hide_missing?
  return true if not hide_blank?

  !(value.nil? || value.empty?) && fields.any? do |f|
    f.display?(HammerCLI::Output::Adapter::Abstract.data_for_field(f, value))
  end
end