class GoodData::Model::BlueprintField
Attributes
Public Class Methods
Source
# File lib/gooddata/models/blueprint/blueprint_field.rb, line 16 def initialize(data, dataset) @data = GoodData::Helpers.symbolize_keys(data) @data[:type] = @data[:type].to_sym @dataset_blueprint = dataset end
Public Instance Methods
Source
# File lib/gooddata/models/blueprint/blueprint_field.rb, line 56 def ==(other) return false unless other.respond_to?(:data) @data == other.data end
Source
# File lib/gooddata/models/blueprint/blueprint_field.rb, line 25 def in_project(project) GoodData::MdObject[id, project: project, client: project.client] end
Returns the md object in associated project or throws error if not present
@return [GoodData::MdObject] md object that is represented in the blueprint
Source
# File lib/gooddata/models/blueprint/blueprint_field.rb, line 29 def method_missing(method_sym, *arguments, &block) if @data.key?(method_sym) @data[method_sym] else super end end
Calls superclass method
Source
# File lib/gooddata/models/blueprint/blueprint_field.rb, line 37 def respond_to_missing?(method_name, include_private = false) if @data.key?(method_name) true else super end end
Calls superclass method
Source
# File lib/gooddata/models/blueprint/blueprint_field.rb, line 45 def title @data[:title] || GoodData::Helpers.titleize(@data[:id]) end
Source
# File lib/gooddata/models/blueprint/blueprint_field.rb, line 52 def validate [] end
Validates the fields in the field
@return [Array] returns list of the errors represented by hash structures
Private Instance Methods
Source
# File lib/gooddata/models/blueprint/blueprint_field.rb, line 63 def validate_presence_of(*fields) fields.reduce([]) do |a, e| data.key?(e) && !data[e].blank? ? a : a + [e] end end