Class: SIPP::SIPPCodeWrapper
Instance Method Summary collapse
- #as_json ⇒ Object
-
#initialize(symbol) ⇒ SIPPCodeWrapper
constructor
A new instance of SIPPCodeWrapper.
- #klass_name ⇒ Object
- #to_s ⇒ Object
- #to_sym ⇒ Object
Methods included from Localiser
Constructor Details
#initialize(symbol) ⇒ SIPPCodeWrapper
Returns a new instance of SIPPCodeWrapper.
15 16 17 |
# File 'lib/sipp.rb', line 15 def initialize(symbol) @sym = symbol end |
Instance Method Details
#as_json ⇒ Object
35 36 37 |
# File 'lib/sipp.rb', line 35 def as_json { klass_name.to_sym => @sym } end |
#klass_name ⇒ Object
23 24 25 26 27 28 29 |
# File 'lib/sipp.rb', line 23 def klass_name self.class.name.split('::').last .gsub(/([A-Z]+)([A-Z][a-z])/, '\1_\2') .gsub(/([a-z\d])([A-Z])/, '\1_\2') .tr(' ', '_') .downcase end |
#to_s ⇒ Object
19 20 21 |
# File 'lib/sipp.rb', line 19 def to_s t klass_name, @sym end |
#to_sym ⇒ Object
31 32 33 |
# File 'lib/sipp.rb', line 31 def to_sym @sym end |