Class: Ebay::Schema::ClassTemplate
- Inherits:
-
Object
- Object
- Ebay::Schema::ClassTemplate
- Defined in:
- lib/ebay/schema/mapper/class_template.rb
Instance Attribute Summary (collapse)
-
- (Object) name
readonly
Returns the value of attribute name.
Instance Method Summary (collapse)
- - (Boolean) exists?
-
- (ClassTemplate) initialize(name) {|_self| ... }
constructor
A new instance of ClassTemplate.
- - (Object) load
- - (Object) render(definition)
Constructor Details
- (ClassTemplate) initialize(name) {|_self| ... }
A new instance of ClassTemplate
12 13 14 15 |
# File 'lib/ebay/schema/mapper/class_template.rb', line 12 def initialize(name) @name = name yield self if block_given? end |
Instance Attribute Details
- (Object) name (readonly)
Returns the value of attribute name
11 12 13 |
# File 'lib/ebay/schema/mapper/class_template.rb', line 11 def name @name end |
Instance Method Details
- (Boolean) exists?
27 28 29 |
# File 'lib/ebay/schema/mapper/class_template.rb', line 27 def exists? File.exists?(template_path) end |
- (Object) load
17 18 19 20 |
# File 'lib/ebay/schema/mapper/class_template.rb', line 17 def load @template = load_template self end |
- (Object) render(definition)
22 23 24 25 |
# File 'lib/ebay/schema/mapper/class_template.rb', line 22 def render(definition) raise TemplateError, "No template has been loaded" if @template.nil? @template.result(definition.send(:binding)) end |