Class: IbRubyProxy::Server::Reflection::IbClass

Inherits:
Object
  • Object
show all
Includes:
Util::StringUtils
Defined in:
lib/ib_ruby_proxy/server/reflection/ib_class.rb

Overview

An ib class

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Util::StringUtils

#to_camel_case, #to_underscore

Constructor Details

#initialize(klass) ⇒ IbClass

Returns a new instance of IbClass.

Parameters:

  • klass (Class)


11
12
13
# File 'lib/ib_ruby_proxy/server/reflection/ib_class.rb', line 11

def initialize(klass)
  @klass = klass
end

Instance Attribute Details

#klassObject (readonly)

Returns the value of attribute klass.



8
9
10
# File 'lib/ib_ruby_proxy/server/reflection/ib_class.rb', line 8

def klass
  @klass
end

Instance Method Details

#full_nameObject

The full qualified class name including namespace

Returns:

  • (Object)


25
26
27
# File 'lib/ib_ruby_proxy/server/reflection/ib_class.rb', line 25

def full_name
  klass.name
end

#java_property_fieldsArray<IbField>

List of ib fields that represent properties to interchange

Returns:



32
33
34
# File 'lib/ib_ruby_proxy/server/reflection/ib_class.rb', line 32

def java_property_fields
  @java_property_fields ||= java_fields.collect { |field| IbField.new(field, self) }
end

#nameString

The class name without including namespaces

Returns:

  • (String)


18
19
20
# File 'lib/ib_ruby_proxy/server/reflection/ib_class.rb', line 18

def name
  klass.name.split('::').last
end

#ruby_property_namesArray<String>

List of ruby properties names that correspond to #java_property_fields

Returns:

  • (Array<String>)


39
40
41
42
43
# File 'lib/ib_ruby_proxy/server/reflection/ib_class.rb', line 39

def ruby_property_names
  @ruby_properties ||= java_property_fields.collect do |field|
    to_underscore(field.name)
  end
end

#zipped_ruby_and_java_propertiesArray<Array<String, IbField>>

Return an array of combinations of #ruby_property_names and ##java_property_fields

Returns:



48
49
50
# File 'lib/ib_ruby_proxy/server/reflection/ib_class.rb', line 48

def zipped_ruby_and_java_properties
  ruby_property_names.zip(java_property_fields)
end