Class: Kettle::Jem::WriteIntent

Inherits:
Object
  • Object
show all
Defined in:
lib/kettle/jem.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(relative_path:, absolute_path:, action:, content: nil, recipe_name: nil, metadata: {}) ⇒ WriteIntent

Returns a new instance of WriteIntent.



1803
1804
1805
1806
1807
1808
1809
1810
# File 'lib/kettle/jem.rb', line 1803

def initialize(relative_path:, absolute_path:, action:, content: nil, recipe_name: nil, metadata: {})
  @relative_path = relative_path.to_s
  @absolute_path = absolute_path.to_s
  @action = action.to_sym
  @content = content
  @recipe_name = recipe_name
  @metadata =  || {}
end

Instance Attribute Details

#absolute_pathObject (readonly)

Returns the value of attribute absolute_path.



1801
1802
1803
# File 'lib/kettle/jem.rb', line 1801

def absolute_path
  @absolute_path
end

#actionObject (readonly)

Returns the value of attribute action.



1801
1802
1803
# File 'lib/kettle/jem.rb', line 1801

def action
  @action
end

#contentObject (readonly)

Returns the value of attribute content.



1801
1802
1803
# File 'lib/kettle/jem.rb', line 1801

def content
  @content
end

#metadataObject (readonly)

Returns the value of attribute metadata.



1801
1802
1803
# File 'lib/kettle/jem.rb', line 1801

def 
  @metadata
end

#recipe_nameObject (readonly)

Returns the value of attribute recipe_name.



1801
1802
1803
# File 'lib/kettle/jem.rb', line 1801

def recipe_name
  @recipe_name
end

#relative_pathObject (readonly)

Returns the value of attribute relative_path.



1801
1802
1803
# File 'lib/kettle/jem.rb', line 1801

def relative_path
  @relative_path
end

Instance Method Details

#delete?Boolean

Returns:

  • (Boolean)


1812
1813
1814
# File 'lib/kettle/jem.rb', line 1812

def delete?
  action == :delete
end

#write?Boolean

Returns:

  • (Boolean)


1816
1817
1818
# File 'lib/kettle/jem.rb', line 1816

def write?
  action == :write
end