Class: Anchor::Types::Property
- Inherits:
-
Data
- Object
- Data
- Anchor::Types::Property
- Defined in:
- lib/anchor/types.rb
Instance Attribute Summary collapse
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#optional ⇒ Object
readonly
Returns the value of attribute optional.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
- #dup(name: nil, type: nil, optional: nil, description: nil) ⇒ Object
-
#initialize(name:, type:, optional: false, description: nil) ⇒ Property
constructor
A new instance of Property.
Constructor Details
#initialize(name:, type:, optional: false, description: nil) ⇒ Property
Returns a new instance of Property.
70 71 72 |
# File 'lib/anchor/types.rb', line 70 def initialize(name:, type:, optional: false, description: nil) super end |
Instance Attribute Details
#description ⇒ Object (readonly)
Returns the value of attribute description
69 70 71 |
# File 'lib/anchor/types.rb', line 69 def description @description end |
#name ⇒ Object (readonly)
Returns the value of attribute name
69 70 71 |
# File 'lib/anchor/types.rb', line 69 def name @name end |
#optional ⇒ Object (readonly)
Returns the value of attribute optional
69 70 71 |
# File 'lib/anchor/types.rb', line 69 def optional @optional end |
#type ⇒ Object (readonly)
Returns the value of attribute type
69 70 71 |
# File 'lib/anchor/types.rb', line 69 def type @type end |
Instance Method Details
#dup(name: nil, type: nil, optional: nil, description: nil) ⇒ Object
74 75 76 77 78 79 80 81 |
# File 'lib/anchor/types.rb', line 74 def dup(name: nil, type: nil, optional: nil, description: nil) self.class.new( name: name || self.name, type: type || self.type, optional: optional.nil? ? self.optional : optional, description: description || self.description, ) end |