class Raml::Node
Attributes
name[R]
@!attribute [r] name
@return [String,Integer] the node name (e.g. resource path, header name, etc). Usually a String. Can be an Integer for methods.
parent[RW]
@!attribute [rw] parent
@return [Raml::Node] the node's parent.
Public Class Methods
new(name, parent)
click to toggle source
# File lib/raml/node.rb, line 14 def initialize(name, parent) @name = name @parent = parent end
Private Instance Methods
camel_case(underscored_word)
click to toggle source
# File lib/raml/node.rb, line 29 def camel_case(underscored_word) w = underscored_word.to_s.split('_') (w[0...1] + w[1..-1].map(&:capitalize)).join end
underscore(camel_cased_word)
click to toggle source
# File lib/raml/node.rb, line 21 def underscore(camel_cased_word) camel_cased_word.to_s.gsub(/::/, '/'). gsub(/([A-Z]+)([A-Z][a-z])/,'\1_\2'). gsub(/([a-z\d])([A-Z])/,'\1_\2'). tr("-", "_"). downcase end