Class: Fields::DataField
- Inherits:
-
LabeledField
- Object
- Field
- LabeledField
- Fields::DataField
- Defined in:
- lib/hammer_cli/output/fields.rb
Instance Attribute Summary collapse
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Attributes inherited from LabeledField
Instance Method Summary collapse
- #get_value(data) ⇒ Object
-
#initialize(options = {}) ⇒ DataField
constructor
A new instance of DataField.
Constructor Details
#initialize(options = {}) ⇒ DataField
Returns a new instance of DataField.
28 29 30 31 |
# File 'lib/hammer_cli/output/fields.rb', line 28 def initialize(={}) @path = [:path] || [] super() end |
Instance Attribute Details
#path ⇒ Object (readonly)
Returns the value of attribute path.
26 27 28 |
# File 'lib/hammer_cli/output/fields.rb', line 26 def path @path end |
Instance Method Details
#get_value(data) ⇒ Object
33 34 35 |
# File 'lib/hammer_cli/output/fields.rb', line 33 def get_value(data) follow_path(data, path || []) end |