Class: Pakyow::Reflection::Attribute Private
- Inherits:
-
Object
- Object
- Pakyow::Reflection::Attribute
- Defined in:
- lib/pakyow/reflection/attribute.rb
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Instance Attribute Summary collapse
- #name ⇒ Object readonly private
- #type ⇒ Object readonly private
Instance Method Summary collapse
-
#initialize(name, type:, required: false) ⇒ Attribute
constructor
private
A new instance of Attribute.
- #named?(name) ⇒ Boolean private
- #required? ⇒ Boolean private
Constructor Details
#initialize(name, type:, required: false) ⇒ Attribute
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of Attribute.
11 12 13 |
# File 'lib/pakyow/reflection/attribute.rb', line 11 def initialize(name, type:, required: false) @name, @type, @required = normalize(name), type, required end |
Instance Attribute Details
#name ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
9 10 11 |
# File 'lib/pakyow/reflection/attribute.rb', line 9 def name @name end |
#type ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
9 10 11 |
# File 'lib/pakyow/reflection/attribute.rb', line 9 def type @type end |
Instance Method Details
#named?(name) ⇒ Boolean
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
15 16 17 |
# File 'lib/pakyow/reflection/attribute.rb', line 15 def named?(name) @name == normalize(name) end |
#required? ⇒ Boolean
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
19 20 21 |
# File 'lib/pakyow/reflection/attribute.rb', line 19 def required? @required == true end |