Class: VimSdk::Property

Inherits:
Object
  • Object
show all
Defined in:
lib/ruby_vim_sdk/property.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, type, version, flags = {}, privilege = nil) ⇒ Property

Returns a new instance of Property.



11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/ruby_vim_sdk/property.rb', line 11

def initialize(name, type, version, flags = {}, privilege = nil)
  @name = VmodlHelper.vmodl_property_to_ruby(name)
  @type = type.kind_of?(Class) ? type : VmodlHelper.vmodl_type_to_ruby(type)
  @wsdl_name = name
  @version = version
  @privilege = privilege
  @expected_type = nil
  @optional = false
  @link = false
  @linkable = false

  flags.each do |key, value|
    case key
      when :optional
        @optional = value
      when :link
        @link = value
      when :linkable
        @linkable = value
      else
        raise "Unknown flag: #{key}"
    end
  end
end

Instance Attribute Details

#expected_typeObject

Returns the value of attribute expected_type.



9
10
11
# File 'lib/ruby_vim_sdk/property.rb', line 9

def expected_type
  @expected_type
end

#nameObject

Returns the value of attribute name.



4
5
6
# File 'lib/ruby_vim_sdk/property.rb', line 4

def name
  @name
end

#privilegeObject

Returns the value of attribute privilege.



8
9
10
# File 'lib/ruby_vim_sdk/property.rb', line 8

def privilege
  @privilege
end

#typeObject

Returns the value of attribute type.



5
6
7
# File 'lib/ruby_vim_sdk/property.rb', line 5

def type
  @type
end

#versionObject

Returns the value of attribute version.



7
8
9
# File 'lib/ruby_vim_sdk/property.rb', line 7

def version
  @version
end

#wsdl_nameObject

Returns the value of attribute wsdl_name.



6
7
8
# File 'lib/ruby_vim_sdk/property.rb', line 6

def wsdl_name
  @wsdl_name
end

Instance Method Details

#link?Boolean

Returns:

  • (Boolean)


40
41
42
# File 'lib/ruby_vim_sdk/property.rb', line 40

def link?
  @link
end

#linkable?Boolean

Returns:

  • (Boolean)


44
45
46
# File 'lib/ruby_vim_sdk/property.rb', line 44

def linkable?
  @linkable
end

#optional?Boolean

Returns:

  • (Boolean)


36
37
38
# File 'lib/ruby_vim_sdk/property.rb', line 36

def optional?
  @optional
end