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.



1823
1824
1825
1826
1827
1828
1829
1830
# File 'lib/kettle/jem.rb', line 1823

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_path ⇒ Object (readonly)

Returns the value of attribute absolute_path.



1821
1822
1823
# File 'lib/kettle/jem.rb', line 1821

def absolute_path
  @absolute_path
end

#action ⇒ Object (readonly)

Returns the value of attribute action.



1821
1822
1823
# File 'lib/kettle/jem.rb', line 1821

def action
  @action
end

#content ⇒ Object (readonly)

Returns the value of attribute content.



1821
1822
1823
# File 'lib/kettle/jem.rb', line 1821

def content
  @content
end

#metadata ⇒ Object (readonly)

Returns the value of attribute metadata.



1821
1822
1823
# File 'lib/kettle/jem.rb', line 1821

def 
  @metadata
end

#recipe_name ⇒ Object (readonly)

Returns the value of attribute recipe_name.



1821
1822
1823
# File 'lib/kettle/jem.rb', line 1821

def recipe_name
  @recipe_name
end

#relative_path ⇒ Object (readonly)

Returns the value of attribute relative_path.



1821
1822
1823
# File 'lib/kettle/jem.rb', line 1821

def relative_path
  @relative_path
end

Instance Method Details

#delete? ⇒ Boolean

Returns:

  • (Boolean)


1832
1833
1834
# File 'lib/kettle/jem.rb', line 1832

def delete?
  action == :delete
end

#write? ⇒ Boolean

Returns:

  • (Boolean)


1836
1837
1838
# File 'lib/kettle/jem.rb', line 1836

def write?
  action == :write
end