Class: Yoda::Model::Descriptions::VariableDescription

Inherits:
Base
  • Object
show all
Defined in:
lib/yoda/model/descriptions/variable_description.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#label

Constructor Details

#initialize(variable:, type:) ⇒ VariableDescription

Returns a new instance of VariableDescription.

Parameters:



13
14
15
16
# File 'lib/yoda/model/descriptions/variable_description.rb', line 13

def initialize(variable:, type:)
  @variable = variable
  @type = type
end

Instance Attribute Details

#typeTypeExpressions::Base (readonly)



9
10
11
# File 'lib/yoda/model/descriptions/variable_description.rb', line 9

def type
  @type
end

#variableSymbol (readonly)

Returns:

  • (Symbol)


6
7
8
# File 'lib/yoda/model/descriptions/variable_description.rb', line 6

def variable
  @variable
end

Instance Method Details

#markup_contentObject



32
33
34
35
36
37
# File 'lib/yoda/model/descriptions/variable_description.rb', line 32

def markup_content
  {
    language: 'ruby',
    value: "#{variable} # #{type}",
  }
end

#sort_textString

Returns:

  • (String)


24
25
26
# File 'lib/yoda/model/descriptions/variable_description.rb', line 24

def sort_text
  variable.to_s
end

#titleString

Returns:

  • (String)


19
20
21
# File 'lib/yoda/model/descriptions/variable_description.rb', line 19

def title
  "#{variable}: #{type}"
end

#to_markdownObject



28
29
30
# File 'lib/yoda/model/descriptions/variable_description.rb', line 28

def to_markdown
  ""
end