Class: GoodData::Model::LabelBlueprintField
- Inherits:
-
BlueprintField
- Object
- BlueprintField
- GoodData::Model::LabelBlueprintField
- Defined in:
- lib/gooddata/models/blueprint/label_field.rb
Instance Attribute Summary
Attributes inherited from BlueprintField
Instance Method Summary collapse
-
#attribute ⇒ AttributeBlueprintField
Returns the attribute this label is referencing to.
-
#gd_data_type ⇒ String
Returns gd_data_type.
-
#gd_type ⇒ String
Returns gd_data_type.
- #reference_label? ⇒ Boolean
-
#validate ⇒ Array
Validates the fields in the label.
Methods inherited from BlueprintField
#==, #id, #in_project, #initialize, #method_missing, #respond_to_missing?, #title
Constructor Details
This class inherits a constructor from GoodData::Model::BlueprintField
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class GoodData::Model::BlueprintField
Instance Method Details
#attribute ⇒ AttributeBlueprintField
Returns the attribute this label is referencing to
15 16 17 |
# File 'lib/gooddata/models/blueprint/label_field.rb', line 15 def attribute dataset_blueprint.attribute_for_label(self) end |
#gd_data_type ⇒ String
Returns gd_data_type
26 27 28 |
# File 'lib/gooddata/models/blueprint/label_field.rb', line 26 def gd_data_type data[:gd_data_type] || Model::DEFAULT_ATTRIBUTE_DATATYPE end |
#gd_type ⇒ String
Returns gd_data_type
33 34 35 |
# File 'lib/gooddata/models/blueprint/label_field.rb', line 33 def gd_type data[:gd_type] || Model::DEFAULT_TYPE end |
#reference_label? ⇒ Boolean
19 20 21 |
# File 'lib/gooddata/models/blueprint/label_field.rb', line 19 def reference_label? data[:reference_label] == true || self == attribute.reference_label end |
#validate ⇒ Array
Validates the fields in the label
40 41 42 43 44 |
# File 'lib/gooddata/models/blueprint/label_field.rb', line 40 def validate validate_presence_of(:id, :reference).map do |e| { type: :error, message: "Field \"#{e}\" is not defined or empty for label \"#{id}\"" } end end |