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.
10 11 12 13 |
# File 'lib/simplefeed/key/type.rb', line 10 def initialize(name, marker, template = nil) super(name, marker) self.template = template end |
Instance Attribute Details
#marker ⇒ Object
Returns the value of attribute marker
7 8 9 |
# File 'lib/simplefeed/key/type.rb', line 7 def marker @marker end |
#name ⇒ Object
Returns the value of attribute name
7 8 9 |
# File 'lib/simplefeed/key/type.rb', line 7 def name @name end |
#template ⇒ Object
Returns the value of attribute template.
8 9 10 |
# File 'lib/simplefeed/key/type.rb', line 8 def template @template end |
Instance Method Details
#render(opts = {}) ⇒ Object
15 16 17 18 |
# File 'lib/simplefeed/key/type.rb', line 15 def render(opts = {}) template.render(opts.merge({ key_type: name, key_marker: marker })) end |