Class: SimpleFeed::Key::Type

Inherits:
Struct
  • Object
show all
Defined in:
lib/simplefeed/key/type.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#markerObject

Returns the value of attribute marker

Returns:

  • (Object)

    the current value of marker


5
6
7
# File 'lib/simplefeed/key/type.rb', line 5

def marker
  @marker
end

#nameObject

Returns the value of attribute name

Returns:

  • (Object)

    the current value of name


5
6
7
# File 'lib/simplefeed/key/type.rb', line 5

def name
  @name
end

#templateObject

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