Class: AVR::RegisterWithModification
- Extended by:
- Forwardable, T::Sig
- Defined in:
- lib/avr/register_with_modification.rb
Instance Attribute Summary collapse
-
#modification ⇒ Object
readonly
Returns the value of attribute modification.
-
#register ⇒ Object
readonly
Returns the value of attribute register.
Attributes inherited from Value
Instance Method Summary collapse
-
#initialize(register, modification = :none) ⇒ RegisterWithModification
constructor
A new instance of RegisterWithModification.
- #name ⇒ Object
Methods inherited from Value
#format, #inspect, #to_i, #to_s, #value_hex
Constructor Details
#initialize(register, modification = :none) ⇒ RegisterWithModification
Returns a new instance of RegisterWithModification.
20 21 22 23 24 |
# File 'lib/avr/register_with_modification.rb', line 20 def initialize(register, modification = :none) @register = register @modification = T.let(T.must(modification), Symbol) super() end |
Instance Attribute Details
#modification ⇒ Object (readonly)
Returns the value of attribute modification.
17 18 19 |
# File 'lib/avr/register_with_modification.rb', line 17 def modification @modification end |
#register ⇒ Object (readonly)
Returns the value of attribute register.
12 13 14 |
# File 'lib/avr/register_with_modification.rb', line 12 def register @register end |
Instance Method Details
#name ⇒ Object
27 28 29 30 31 32 33 |
# File 'lib/avr/register_with_modification.rb', line 27 def name '%s%s%s' % [ modification == :pre_decrement ? '-' : '', register.to_s, modification == :post_increment ? '+' : '', ] end |