Class: Rod::Rest::PropertyMetadata

Inherits:
Object
  • Object
show all
Defined in:
lib/rod/rest/property_metadata.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, options) ⇒ PropertyMetadata

Creates new property metadata using the name and options.

Raises:

  • (ArgumentError)


7
8
9
10
11
12
# File 'lib/rod/rest/property_metadata.rb', line 7

def initialize(name, options)
  raise ArgumentError.new("nil name") if name.nil?
  @name = name.to_s
  @symbolic_name = @name.to_sym
  @index = options[:index]
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



4
5
6
# File 'lib/rod/rest/property_metadata.rb', line 4

def name
  @name
end

#symbolic_nameObject (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.

Returns:

  • (Boolean)


15
16
17
# File 'lib/rod/rest/property_metadata.rb', line 15

def indexed?
  !! @index
end

#inspectObject

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_sObject

Short description of the poperty.



27
28
29
# File 'lib/rod/rest/property_metadata.rb', line 27

def to_s
  "'#{@name}' property"
end