Class: SimpleFeed::Key::Type
- Inherits:
-
Struct
- Object
- Struct
- SimpleFeed::Key::Type
- Defined in:
- lib/simplefeed/key/type.rb
Instance Attribute Summary collapse
-
#marker ⇒ Object
Returns the value of attribute marker.
-
#name ⇒ Object
Returns the value of attribute name.
-
#template ⇒ Object
Returns the value of attribute template.
Instance Method Summary collapse
-
#initialize(name, marker, template = nil) ⇒ Type
constructor
A new instance of Type.
- #render(opts = {}) ⇒ Object
Constructor Details
#initialize(name, marker, template = nil) ⇒ Type
Returns a new instance of Type.
8 9 10 11 |
# File 'lib/simplefeed/key/type.rb', line 8 def initialize(name, marker, template = nil) super(name, marker) self.template = template end |
Instance Attribute Details
#marker ⇒ Object
Returns the value of attribute marker
5 6 7 |
# File 'lib/simplefeed/key/type.rb', line 5 def marker @marker end |
#name ⇒ Object
Returns the value of attribute name
5 6 7 |
# File 'lib/simplefeed/key/type.rb', line 5 def name @name end |
#template ⇒ Object
Returns the value of attribute template.
6 7 8 |
# File 'lib/simplefeed/key/type.rb', line 6 def template @template end |
Instance Method Details
#render(opts = {}) ⇒ Object
13 14 15 |
# File 'lib/simplefeed/key/type.rb', line 13 def render(opts = {}) self.template.render(opts.merge({ 'key_type' => name, 'key_marker' => marker })) end |