Class: Trane::RepresentationDefinition

Inherits:
Data
  • Object
show all
Defined in:
lib/trane/representation_definition.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name:, fields: []) ⇒ RepresentationDefinition

Returns a new instance of RepresentationDefinition.



5
6
7
8
9
10
# File 'lib/trane/representation_definition.rb', line 5

def initialize(name:, fields: [])
  if name.nil? || name.to_s.empty?
    raise ArgumentError, "RepresentationDefinition name cannot be nil or empty"
  end
  super(name: name.to_sym, fields: fields.freeze)
end

Instance Attribute Details

#fieldsObject (readonly)

Returns the value of attribute fields

Returns:

  • (Object)

    the current value of fields



4
5
6
# File 'lib/trane/representation_definition.rb', line 4

def fields
  @fields
end

#nameObject (readonly)

Returns the value of attribute name

Returns:

  • (Object)

    the current value of name



4
5
6
# File 'lib/trane/representation_definition.rb', line 4

def name
  @name
end