Sha256: d85f17e4c19fca68b1b4c4d2f43077d9d485d99782c60a934c2ee688220879fd
Contents?: true
Size: 709 Bytes
Versions: 13
Compression:
Stored size: 709 Bytes
Contents
module WebIDL module Ast class Type < Node def initialize(parent, name, opts = {}) super(parent) @name = camel_case_type(name.strip).to_sym @nullable = !!opts[:nullable] @array = !!opts[:array] end def nullable? @nullable end def array? @array end def array=(bool) @array = bool end def nullable=(bool) @nullable = bool end def name (array? ? "#{@name}Array" : @name).to_sym end private def camel_case_type(name) name.split(/[_ ]/).map { |e| e[0,1] = e[0,1].upcase; e }.join end end # Type end # Ast end # WebIDL
Version data entries
13 entries across 13 versions & 1 rubygems