Class: Lagoon::Result

Inherits:
Data
  • Object
show all
Defined in:
lib/lagoon/result.rb,
sig/lagoon.rbs

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(path:, content:, warnings: [], counts: {}) ⇒ Result

Returns a new instance of Result.

Parameters:

  • path: (String)
  • content: (String)
  • warnings: (Array[String]) (defaults to: [])
  • counts: (counts_hash) (defaults to: {})


5
6
7
8
9
10
11
12
# File 'lib/lagoon/result.rb', line 5

def initialize(path:, content:, warnings: [], counts: {})
  super(
    path: path.to_s.freeze,
    content: content.to_s.freeze,
    warnings: warnings.map(&:to_s).freeze,
    counts: counts.transform_keys(&:to_sym).freeze
  )
end

Instance Attribute Details

#contentObject (readonly)

Returns the value of attribute content

Returns:

  • (Object)

    the current value of content



4
5
6
# File 'lib/lagoon/result.rb', line 4

def content
  @content
end

#countsObject (readonly)

Returns the value of attribute counts

Returns:

  • (Object)

    the current value of counts



4
5
6
# File 'lib/lagoon/result.rb', line 4

def counts
  @counts
end

#pathObject (readonly)

Returns the value of attribute path

Returns:

  • (Object)

    the current value of path



4
5
6
# File 'lib/lagoon/result.rb', line 4

def path
  @path
end

#warningsObject (readonly)

Returns the value of attribute warnings

Returns:

  • (Object)

    the current value of warnings



4
5
6
# File 'lib/lagoon/result.rb', line 4

def warnings
  @warnings
end

Instance Method Details

#to_pathString

Returns:

  • (String)


18
19
20
# File 'lib/lagoon/result.rb', line 18

def to_path
  path
end

#to_sString

Returns:

  • (String)


14
15
16
# File 'lib/lagoon/result.rb', line 14

def to_s
  path
end