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.
14 15 16 17 18 |
# File 'lib/xumlidot/types/attribute.rb', line 14 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.
10 11 12 |
# File 'lib/xumlidot/types/attribute.rb', line 10 def name @name end |
#read ⇒ Object
Returns the value of attribute read.
10 11 12 |
# File 'lib/xumlidot/types/attribute.rb', line 10 def read @read end |
#write ⇒ Object
Returns the value of attribute write.
10 11 12 |
# File 'lib/xumlidot/types/attribute.rb', line 10 def write @write end |
Instance Method Details
#to_s ⇒ Object
20 21 22 |
# File 'lib/xumlidot/types/attribute.rb', line 20 def to_s accessibility ? "(#{accessibility}) #{@name}" : @name end |