Class: AttributeDefinition

Inherits:
RestObject show all
Defined in:
lib/rally_rest_api/attribute_definition.rb

Overview

:nodoc:

Instance Attribute Summary

Attributes inherited from RestObject

#rally_rest

Instance Method Summary collapse

Methods inherited from RestObject

#<=>, #==, #delete, #elements, #eql?, #hash, #marshal_dump, #marshal_load, #method_missing, #oid, #parse_document, #refresh, #save!, #to_hash, #type=, #type_as_symbol, #typedef, #underscore, #update

Constructor Details

#initialize(rally_rest, values) ⇒ AttributeDefinition

Returns a new instance of AttributeDefinition.



5
6
7
8
# File 'lib/rally_rest_api/attribute_definition.rb', line 5

def initialize(rally_rest, values)
  super(rally_rest)
  @elements = values
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class RestObject

Instance Method Details

#allowed_valuesObject



30
31
32
# File 'lib/rally_rest_api/attribute_definition.rb', line 30

def allowed_values
  self.elements[:allowed_values].map {|e| e[:string_value] }
end

#bodyObject

return the XML of the resource



11
12
13
# File 'lib/rally_rest_api/attribute_definition.rb', line 11

def body
  nil
end

#nameObject

The name of the object, without having to read the entire body



21
22
23
# File 'lib/rally_rest_api/attribute_definition.rb', line 21

def name
  @elements[:name]
end

#refObject

the resource’s URI



16
17
18
# File 'lib/rally_rest_api/attribute_definition.rb', line 16

def ref
  nil
end

#typeObject

The type of the underlying resource



26
27
28
# File 'lib/rally_rest_api/attribute_definition.rb', line 26

def type
  "AttributeDefinition"
end