Sha256: f427607e10619d98e25b6d980247aa4fdaa1f314685424654626898e54f63df4
Contents?: true
Size: 762 Bytes
Versions: 9
Compression:
Stored size: 762 Bytes
Contents
module ReportsKit module Reports class Dimension attr_accessor :properties def initialize(properties) raise ArgumentError.new('Blank properties') if properties.blank? properties = { key: properties } if properties.is_a?(String) raise ArgumentError.new("Dimension properties must be a String or Hash, not a #{properties.class.name}: #{properties.inspect}") unless properties.is_a?(Hash) properties = properties.deep_symbolize_keys self.properties = properties end def key properties[:key] end def expression properties[:expression] || key end def label properties.key?(:label) ? properties[:label] : key.titleize end end end end
Version data entries
9 entries across 9 versions & 1 rubygems