Class: Dato::Dump::Dsl::DataFile

Inherits:
Object
  • Object
show all
Defined in:
lib/dato/dump/dsl/create_post.rb

Instance Method Summary collapse

Constructor Details

#initialize(operation, &block) ⇒ DataFile

Returns a new instance of DataFile.



9
10
11
12
# File 'lib/dato/dump/dsl/create_post.rb', line 9

def initialize(operation, &block)
  @operation = operation
  instance_eval(&block)
end

Instance Method Details

#content(value) ⇒ Object



19
20
21
# File 'lib/dato/dump/dsl/create_post.rb', line 19

def content(value)
  @operation.content = value
end

#frontmatter(format, value) ⇒ Object



14
15
16
17
# File 'lib/dato/dump/dsl/create_post.rb', line 14

def frontmatter(format, value)
  @operation.frontmatter_format = format
  @operation.frontmatter_value = value
end