Class: Defgen::Property::Attributes
- Inherits:
-
Object
- Object
- Defgen::Property::Attributes
- Defined in:
- lib/defgen/property/attributes.rb
Constant Summary collapse
- VALID_OWNERSHIPS =
[:strong, :weak, :assign, :unsafe_unretained, :retain, :copy]
Instance Attribute Summary collapse
-
#getter ⇒ Object
Returns the value of attribute getter.
-
#ownership ⇒ Object
Returns the value of attribute ownership.
-
#property ⇒ Object
Returns the value of attribute property.
Instance Method Summary collapse
- #formatted_getter ⇒ Object
-
#initialize ⇒ Attributes
constructor
A new instance of Attributes.
- #to_s ⇒ Object
Constructor Details
#initialize ⇒ Attributes
Returns a new instance of Attributes.
8 9 10 |
# File 'lib/defgen/property/attributes.rb', line 8 def initialize @ownership = :strong end |
Instance Attribute Details
#getter ⇒ Object
Returns the value of attribute getter.
6 7 8 |
# File 'lib/defgen/property/attributes.rb', line 6 def getter @getter end |
#ownership ⇒ Object
Returns the value of attribute ownership.
6 7 8 |
# File 'lib/defgen/property/attributes.rb', line 6 def ownership @ownership end |
#property ⇒ Object
Returns the value of attribute property.
6 7 8 |
# File 'lib/defgen/property/attributes.rb', line 6 def property @property end |
Instance Method Details
#formatted_getter ⇒ Object
28 29 30 31 32 |
# File 'lib/defgen/property/attributes.rb', line 28 def formatted_getter unless getter.nil? || getter.empty? "getter=#{property.prefix.downcase}_#{getter}" end end |
#to_s ⇒ Object
24 25 26 |
# File 'lib/defgen/property/attributes.rb', line 24 def to_s "(#{['nonatomic', ownership, formatted_getter].compact.join(', ')})" end |