Module: IDL::Ruby::LeafMixin
- Defined in:
- lib/ridlbe/ruby/config.rb
Constant Summary collapse
- RESERVED_RUBY_CONST =
%w(Array Bignum Binding Class Continuation Dir Exception FalseClass File Fixnum Float Hash Integer IO MatchData Method Module NilClass Numeric Object Proc Process Range Regexp String Struct Symbol Thread ThreadGroup Time TrueClass UnboundMethod Comparable Enumerable Errno FileTest GC Kernel Marshal Math ObjectSpace Signal)
- RESERVED_RUBY_MEMBER =
%w(untaint id instance_variable_get inspect taint public_methods __send__ to_a display instance_eval extend clone protected_methods hash freeze type instance_variable_set methods instance_variables to_s method dup private_methods object_id send __id__ singleton_methods proc readline global_variables singleton_method_removed callcc syscall fail untrace_var load srand puts catch chomp initialize_copy format scan print abort fork gsub trap test select initialize method_missing lambda readlines local_variables singleton_method_undefined system open caller eval set_trace_func require rand singleton_method_added throw gets binding raise warn getc exec trace_var irb_binding at_exit split putc loop chop sprintf p remove_instance_variable exit printf sleep sub autoload)
Instance Method Summary collapse
Instance Method Details
#ruby_lm_name ⇒ Object
277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 |
# File 'lib/ridlbe/ruby/config.rb', line 277 def ruby_lm_name unless @lm_name ret = @name.checked_name.dup case self when IDL::AST::Port, IDL::AST::StateMember, IDL::AST::Initializer, IDL::AST::Parameter, IDL::AST::Operation, IDL::AST::Attribute, IDL::AST::Member, IDL::AST::UnionMember # member names ret = ret[0, 1].downcase + ret[1, ret.size].to_s ret = 'r_' + ret if IDL::Ruby::LeafMixin::RESERVED_RUBY_MEMBER.include?(ret) else # class/module names ret = ret[0, 1].upcase + ret[1, ret.size].to_s is_scoped = @enclosure && !@enclosure.scopes.empty? ret = 'R_' + ret if !is_scoped && IDL::Ruby::LeafMixin::RESERVED_RUBY_CONST.include?(ret) end @lm_name = ret end @lm_name end |
#rubyname ⇒ Object
303 304 305 |
# File 'lib/ridlbe/ruby/config.rb', line 303 def rubyname lm_name end |
#scoped_rubyname ⇒ Object
307 308 309 |
# File 'lib/ridlbe/ruby/config.rb', line 307 def scoped_rubyname scoped_lm_name end |