Class: Fort::Type::Character

Inherits:
Base
  • Object
show all
Defined in:
lib/fort/type.rb

Constant Summary

Constants included from Providable

Providable::ID_GENERATOR

Instance Attribute Summary collapse

Attributes inherited from Base

#dim, #id, #type

Instance Method Summary collapse

Methods inherited from Base

#dimension, #parenthesis

Methods included from Providable

#multi_provide, #provide

Constructor Details

#initialize(id, params) ⇒ Character

Returns a new instance of Character.



119
120
121
122
# File 'lib/fort/type.rb', line 119

def initialize(id, params)
  super
  @len = params.fetch(:len)
end

Instance Attribute Details

#lenObject (readonly)

Returns the value of attribute len.



123
124
125
# File 'lib/fort/type.rb', line 123

def len
  @len
end

Instance Method Details

#declareObject



129
130
131
# File 'lib/fort/type.rb', line 129

def declare
  "#{@type}(len=#{@len})#{dimension()}"
end

#to_sObject



125
126
127
# File 'lib/fort/type.rb', line 125

def to_s
  super + "Len#{len_str()}"
end