Class: Rod::Rest::PropertyMetadata
- Inherits:
-
Object
- Object
- Rod::Rest::PropertyMetadata
- Defined in:
- lib/rod/rest/property_metadata.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#symbolic_name ⇒ Object
readonly
Returns the value of attribute symbolic_name.
Instance Method Summary collapse
-
#indexed? ⇒ Boolean
Returns true if the property is indexed.
-
#initialize(name, options) ⇒ PropertyMetadata
constructor
Creates new property metadata using the
name
andoptions
. -
#inspect ⇒ Object
Detailed description of the porperty, i.e.
-
#to_s ⇒ Object
Short description of the poperty.
Constructor Details
#initialize(name, options) ⇒ PropertyMetadata
Creates new property metadata using the name
and options
.
7 8 9 10 11 12 |
# File 'lib/rod/rest/property_metadata.rb', line 7 def initialize(name, ) raise ArgumentError.new("nil name") if name.nil? @name = name.to_s @symbolic_name = @name.to_sym @index = [:index] end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
4 5 6 |
# File 'lib/rod/rest/property_metadata.rb', line 4 def name @name end |
#symbolic_name ⇒ Object (readonly)
Returns the value of attribute symbolic_name.
4 5 6 |
# File 'lib/rod/rest/property_metadata.rb', line 4 def symbolic_name @symbolic_name end |
Instance Method Details
#indexed? ⇒ Boolean
Returns true if the property is indexed.
15 16 17 |
# File 'lib/rod/rest/property_metadata.rb', line 15 def indexed? !! @index end |
#inspect ⇒ Object
Detailed description of the porperty, i.e. Rod::Rest::PropertyMetadata<name>
21 22 23 24 |
# File 'lib/rod/rest/property_metadata.rb', line 21 def inspect indexed = indexed? ? ",indexed" : "" "Property<#{@name}#{indexed}>" end |
#to_s ⇒ Object
Short description of the poperty.
27 28 29 |
# File 'lib/rod/rest/property_metadata.rb', line 27 def to_s "'#{@name}' property" end |