Class: OData::Singleton

Inherits:
Object
  • Object
show all
Defined in:
lib/odata/singleton.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Singleton


6
7
8
9
10
# File 'lib/odata/singleton.rb', line 6

def initialize(options = {})
  @name      = options[:name]
  @type_name = options[:type]
  @service   = options[:service]
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name


3
4
5
# File 'lib/odata/singleton.rb', line 3

def name
  @name
end

#type_nameObject (readonly)

Returns the value of attribute type_name


4
5
6
# File 'lib/odata/singleton.rb', line 4

def type_name
  @type_name
end

Instance Method Details

#collection?Boolean


12
13
14
# File 'lib/odata/singleton.rb', line 12

def collection?
  false
end

#typeObject


16
17
18
# File 'lib/odata/singleton.rb', line 16

def type
  @service.get_type_by_name(type_name)
end