Class: Xumlidot::Types::Attribute
- Inherits:
-
Object
- Object
- Xumlidot::Types::Attribute
- Defined in:
- lib/xumlidot/types/attribute.rb
Overview
Value object for an attribute, i.e. accessor defined via attr_reader, attr_writer or attribute
Instance Attribute Summary collapse
-
#name ⇒ Object
Returns the value of attribute name.
-
#read ⇒ Object
Returns the value of attribute read.
-
#write ⇒ Object
Returns the value of attribute write.
Instance Method Summary collapse
-
#initialize(name, read, write) ⇒ Attribute
constructor
A new instance of Attribute.
- #to_s ⇒ Object
Constructor Details
#initialize(name, read, write) ⇒ Attribute
Returns a new instance of Attribute.
15 16 17 18 19 |
# File 'lib/xumlidot/types/attribute.rb', line 15 def initialize(name, read, write) @name = name.to_s @read = read @write = write end |
Instance Attribute Details
#name ⇒ Object
Returns the value of attribute name.
11 12 13 |
# File 'lib/xumlidot/types/attribute.rb', line 11 def name @name end |
#read ⇒ Object
Returns the value of attribute read.
11 12 13 |
# File 'lib/xumlidot/types/attribute.rb', line 11 def read @read end |
#write ⇒ Object
Returns the value of attribute write.
11 12 13 |
# File 'lib/xumlidot/types/attribute.rb', line 11 def write @write end |
Instance Method Details
#to_s ⇒ Object
21 22 23 |
# File 'lib/xumlidot/types/attribute.rb', line 21 def to_s "(#{accessibility}) #{@name}" end |