Class: RedSnow::Sourcemap::Node

Inherits:
Object
  • Object
show all
Defined in:
lib/redsnow/sourcemap.rb

Overview

Base Node - holds @collection

Direct Known Subclasses

Headers, Metadata, NamedNode, Parameters

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(sourcemap) ⇒ Node

Returns a new instance of Node.

Parameters:

  • sourcemap (json array or nil)


12
13
14
15
16
17
18
19
20
# File 'lib/redsnow/sourcemap.rb', line 12

def initialize(sourcemap)
  @collection = []

  return if sourcemap.nil?

  sourcemap.each do |sm|
    @collection << SourceMap.new(sm)
  end
end

Instance Attribute Details

#collectionObject

Returns the value of attribute collection.



9
10
11
# File 'lib/redsnow/sourcemap.rb', line 9

def collection
  @collection
end