Class: IbRubyProxy::Server::Reflection::IbField
- Inherits:
-
Object
- Object
- IbRubyProxy::Server::Reflection::IbField
- Defined in:
- lib/ib_ruby_proxy/server/reflection/ib_field.rb
Overview
An IbClass field
Constant Summary collapse
- IB_FIELD_PREFIX =
/^m_/.freeze
Instance Attribute Summary collapse
-
#ib_class ⇒ Object
readonly
Returns the value of attribute ib_class.
-
#java_field ⇒ Object
readonly
Returns the value of attribute java_field.
Instance Method Summary collapse
-
#default_value ⇒ Object
Default value for the field.
-
#default_value_as_string ⇒ String
Default value as a string.
-
#initialize(java_field, ib_class) ⇒ IbField
constructor
A new instance of IbField.
-
#name ⇒ String
Return the name of the accessor method used to access the field.
Constructor Details
#initialize(java_field, ib_class) ⇒ IbField
Returns a new instance of IbField.
10 11 12 13 |
# File 'lib/ib_ruby_proxy/server/reflection/ib_field.rb', line 10 def initialize(java_field, ib_class) @java_field = java_field @ib_class = ib_class end |
Instance Attribute Details
#ib_class ⇒ Object (readonly)
Returns the value of attribute ib_class.
8 9 10 |
# File 'lib/ib_ruby_proxy/server/reflection/ib_field.rb', line 8 def ib_class @ib_class end |
#java_field ⇒ Object (readonly)
Returns the value of attribute java_field.
8 9 10 |
# File 'lib/ib_ruby_proxy/server/reflection/ib_field.rb', line 8 def java_field @java_field end |
Instance Method Details
#default_value ⇒ Object
Default value for the field
18 19 20 21 22 23 24 25 |
# File 'lib/ib_ruby_proxy/server/reflection/ib_field.rb', line 18 def default_value case java_field.type when Java::int.java_class, Java::float.java_class, Java::double.java_class 0 when Java::boolean.java_class false end end |
#default_value_as_string ⇒ String
Default value as a string
30 31 32 33 34 35 36 37 |
# File 'lib/ib_ruby_proxy/server/reflection/ib_field.rb', line 30 def default_value_as_string value = default_value if value.nil? 'nil' else value.to_s end end |
#name ⇒ String
Return the name of the accessor method used to access the field
42 43 44 |
# File 'lib/ib_ruby_proxy/server/reflection/ib_field.rb', line 42 def name @name ||= find_name end |