Class: Trane::RepresentationDefinition
- Inherits:
-
Data
- Object
- Data
- Trane::RepresentationDefinition
- Defined in:
- lib/trane/representation_definition.rb
Instance Attribute Summary collapse
-
#fields ⇒ Object
readonly
Returns the value of attribute fields.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(name:, fields: []) ⇒ RepresentationDefinition
constructor
A new instance of RepresentationDefinition.
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
#fields ⇒ Object (readonly)
Returns the value of attribute fields
4 5 6 |
# File 'lib/trane/representation_definition.rb', line 4 def fields @fields end |
#name ⇒ Object (readonly)
Returns the value of attribute name
4 5 6 |
# File 'lib/trane/representation_definition.rb', line 4 def name @name end |