Class: ActiveRecord::LookML::ArrayField
- Inherits:
-
Object
- Object
- ActiveRecord::LookML::ArrayField
- Defined in:
- lib/active_record/lookml/array_field.rb
Instance Method Summary collapse
-
#initialize(name:, values:) ⇒ ArrayField
constructor
A new instance of ArrayField.
- #to_lookml(indent_level: 0) ⇒ Object
Constructor Details
#initialize(name:, values:) ⇒ ArrayField
Returns a new instance of ArrayField.
4 5 6 7 |
# File 'lib/active_record/lookml/array_field.rb', line 4 def initialize(name:, values:) @name = name @values = values end |
Instance Method Details
#to_lookml(indent_level: 0) ⇒ Object
9 10 11 12 13 14 15 16 17 18 |
# File 'lib/active_record/lookml/array_field.rb', line 9 def to_lookml(indent_level: 0) indent = ' ' * indent_level lookml = "#{indent}#{@name}: [\n" lookml << @values.map do |value| "#{indent} #{value}" end.join(",\n") lookml << "\n" lookml << "#{indent}]\n" lookml end |