Class: Yoda::Model::Descriptions::VariableDescription
- Defined in:
- lib/yoda/model/descriptions/variable_description.rb
Instance Attribute Summary collapse
- #type ⇒ TypeExpressions::Base readonly
- #variable ⇒ Symbol readonly
Instance Method Summary collapse
-
#initialize(variable:, type:) ⇒ VariableDescription
constructor
A new instance of VariableDescription.
- #markup_content ⇒ Object
- #sort_text ⇒ String
- #title ⇒ String
- #to_markdown ⇒ Object
Methods inherited from Base
Constructor Details
#initialize(variable:, type:) ⇒ VariableDescription
Returns a new instance of VariableDescription.
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
#type ⇒ TypeExpressions::Base (readonly)
9 10 11 |
# File 'lib/yoda/model/descriptions/variable_description.rb', line 9 def type @type end |
#variable ⇒ Symbol (readonly)
6 7 8 |
# File 'lib/yoda/model/descriptions/variable_description.rb', line 6 def variable @variable end |
Instance Method Details
#markup_content ⇒ Object
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_text ⇒ String
24 25 26 |
# File 'lib/yoda/model/descriptions/variable_description.rb', line 24 def sort_text variable.to_s end |
#title ⇒ String
19 20 21 |
# File 'lib/yoda/model/descriptions/variable_description.rb', line 19 def title "#{variable}: #{type}" end |
#to_markdown ⇒ Object
28 29 30 |
# File 'lib/yoda/model/descriptions/variable_description.rb', line 28 def to_markdown "" end |