Class: Fields::Field
- Inherits:
-
Object
- Object
- Fields::Field
- Defined in:
- lib/hammer_cli/output/fields.rb
Instance Attribute Summary collapse
-
#label ⇒ Object
readonly
Returns the value of attribute label.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Instance Method Summary collapse
- #display?(value) ⇒ Boolean
- #hide_blank? ⇒ Boolean
-
#initialize(options = {}) ⇒ Field
constructor
A new instance of Field.
- #parameters ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ Field
Returns a new instance of Field.
10 11 12 13 14 15 |
# File 'lib/hammer_cli/output/fields.rb', line 10 def initialize(={}) @hide_blank = [:hide_blank].nil? ? false : [:hide_blank] @path = [:path] || [] @label = [:label] = end |
Instance Attribute Details
#label ⇒ Object (readonly)
Returns the value of attribute label.
7 8 9 |
# File 'lib/hammer_cli/output/fields.rb', line 7 def label @label end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
8 9 10 |
# File 'lib/hammer_cli/output/fields.rb', line 8 def path @path end |
Instance Method Details
#display?(value) ⇒ Boolean
21 22 23 24 25 26 27 28 29 |
# File 'lib/hammer_cli/output/fields.rb', line 21 def display?(value) if not hide_blank? true elsif value.nil? false else true end end |
#hide_blank? ⇒ Boolean
17 18 19 |
# File 'lib/hammer_cli/output/fields.rb', line 17 def hide_blank? @hide_blank end |
#parameters ⇒ Object
31 32 33 |
# File 'lib/hammer_cli/output/fields.rb', line 31 def parameters end |