Class: EasySwig::Features

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

Direct Known Subclasses

Csharp::CsharpFeatures

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.create_instance(lang) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
# File 'lib/features.rb', line 5

def Features.create_instance(lang)
  ret = case lang
  when 'java'
    EasySwig::Java::JavaFeatures.new
  when 'csharp'
    EasySwig::Csharp::CsharpFeatures.new
  else
  	EasySwig::Csharp::CsharpFeatures.new
  end
  ret
end

Instance Method Details

#empty?Boolean

Returns:

  • (Boolean)


17
18
19
# File 'lib/features.rb', line 17

def empty?
  false
end

#infer_native_name(node) ⇒ Object



29
30
31
32
33
# File 'lib/features.rb', line 29

def infer_native_name(node)
  node.basename ||= node.target_name.gsub(".", "::").gsub(/_([a-z])/i) { |match|
    $1.upcase
  }
end

#infer_target_name(node) ⇒ Object



35
36
37
# File 'lib/features.rb', line 35

def infer_target_name(node)
  node.target_name ||= node.basename.gsub("::", ".")
end

#to_sObject



21
22
23
# File 'lib/features.rb', line 21

def to_s
  ""
end

#to_strObject



25
26
27
# File 'lib/features.rb', line 25

def to_str
  to_s
end