Class: YARD::Virtus::CodeObjects::AttributeReader
- Inherits:
-
Object
- Object
- YARD::Virtus::CodeObjects::AttributeReader
- Defined in:
- lib/yard/virtus/code_objects/attribute_reader.rb
Instance Attribute Summary collapse
-
#attr_name ⇒ Object
readonly
Returns the value of attribute attr_name.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(attr, type) ⇒ AttributeReader
constructor
A new instance of AttributeReader.
- #method_name ⇒ Object
- #yard_method_object(namespace) ⇒ Object
Constructor Details
#initialize(attr, type) ⇒ AttributeReader
Returns a new instance of AttributeReader.
9 10 11 12 |
# File 'lib/yard/virtus/code_objects/attribute_reader.rb', line 9 def initialize(attr, type) @attr_name = attr @type = type end |
Instance Attribute Details
#attr_name ⇒ Object (readonly)
Returns the value of attribute attr_name.
5 6 7 |
# File 'lib/yard/virtus/code_objects/attribute_reader.rb', line 5 def attr_name @attr_name end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
5 6 7 |
# File 'lib/yard/virtus/code_objects/attribute_reader.rb', line 5 def type @type end |
Instance Method Details
#method_name ⇒ Object
14 15 16 |
# File 'lib/yard/virtus/code_objects/attribute_reader.rb', line 14 def method_name attr_name end |
#yard_method_object(namespace) ⇒ Object
18 19 20 21 22 |
# File 'lib/yard/virtus/code_objects/attribute_reader.rb', line 18 def yard_method_object(namespace) YARD::CodeObjects::MethodObject.new(namespace, method_name, :instance).tap do |mo| mo.add_tag YARD::Tags::Library.new.return_tag("[#{type}]") end end |