Class: Pictify::TemplateVariableDefinition

Inherits:
Object
  • Object
show all
Defined in:
lib/pictify/types.rb

Overview

A variable definition declared on a template.

The API keys variables by name and may include type, defaultValue, description, and validation. Unknown engine-specific fields are kept in raw.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data) ⇒ TemplateVariableDefinition

Returns a new instance of TemplateVariableDefinition.



171
172
173
174
175
176
177
178
# File 'lib/pictify/types.rb', line 171

def initialize(data)
  @raw = data
  @name = data["name"]
  @type = data["type"]
  @default_value = data["defaultValue"]
  @description = data["description"]
  @validation = data["validation"]
end

Instance Attribute Details

#default_valueObject (readonly)

Returns the value of attribute default_value.



169
170
171
# File 'lib/pictify/types.rb', line 169

def default_value
  @default_value
end

#descriptionObject (readonly)

Returns the value of attribute description.



169
170
171
# File 'lib/pictify/types.rb', line 169

def description
  @description
end

#nameObject (readonly)

Returns the value of attribute name.



169
170
171
# File 'lib/pictify/types.rb', line 169

def name
  @name
end

#rawObject (readonly)

Returns the value of attribute raw.



169
170
171
# File 'lib/pictify/types.rb', line 169

def raw
  @raw
end

#typeObject (readonly)

Returns the value of attribute type.



169
170
171
# File 'lib/pictify/types.rb', line 169

def type
  @type
end

#validationObject (readonly)

Returns the value of attribute validation.



169
170
171
# File 'lib/pictify/types.rb', line 169

def validation
  @validation
end