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.



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

#markerObject

Returns the value of attribute marker

Returns:

  • (Object)

    the current value of marker



7
8
9
# File 'lib/simplefeed/key/type.rb', line 7

def marker
  @marker
end

#nameObject

Returns the value of attribute name

Returns:

  • (Object)

    the current value of name



7
8
9
# File 'lib/simplefeed/key/type.rb', line 7

def name
  @name
end

#templateObject

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