Class: Hospodar::Builder::BuilderParams

Inherits:
Struct
  • Object
show all
Defined in:
lib/hospodar/builder/assembler.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#groupObject

Returns the value of attribute group

Returns:

  • (Object)

    the current value of group



13
14
15
# File 'lib/hospodar/builder/assembler.rb', line 13

def group
  @group
end

#objectObject

Returns the value of attribute object

Returns:

  • (Object)

    the current value of object



13
14
15
# File 'lib/hospodar/builder/assembler.rb', line 13

def object
  @object
end

#titleObject

Returns the value of attribute title

Returns:

  • (Object)

    the current value of title



13
14
15
# File 'lib/hospodar/builder/assembler.rb', line 13

def title
  @title
end

Instance Method Details

#check!Object

Raises:

  • (ArgumentError)


18
19
20
21
22
# File 'lib/hospodar/builder/assembler.rb', line 18

def check!
  return unless invalid?

  raise(ArgumentError, 'Please provide object: and title: arguments')
end

#invalid?Boolean

Returns:

  • (Boolean)


24
25
26
# File 'lib/hospodar/builder/assembler.rb', line 24

def invalid?
  (group.nil? && title.nil?) ^ object.nil?
end

#to_aObject



14
15
16
# File 'lib/hospodar/builder/assembler.rb', line 14

def to_a
  [group, title, proc { object }]
end