Class: Versionub::Type
- Inherits:
-
Object
- Object
- Versionub::Type
- Defined in:
- lib/versionub/type.rb
Defined Under Namespace
Classes: Instance
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
- #create(data) ⇒ Object
-
#initialize(name, &block) ⇒ Type
constructor
A new instance of Type.
- #parse(text) ⇒ Object
Constructor Details
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
80 81 82 |
# File 'lib/versionub/type.rb', line 80 def name @name end |
Instance Method Details
#create(data) ⇒ Object
99 100 101 |
# File 'lib/versionub/type.rb', line 99 def create (data) @instance.new(name, nil, data) end |
#parse(text) ⇒ Object
89 90 91 92 93 94 95 96 97 |
# File 'lib/versionub/type.rb', line 89 def parse (text) data = @instance.parser.new.parse(text) if @instance.transformer data = @instance.transformer.new.apply(data) end @instance.new(name, text, data) end |