Class: Superstructure::AttributeParser

Inherits:
Object
  • Object
show all
Defined in:
lib/superstructure/attribute_parser.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(arguments, opts) ⇒ AttributeParser

Returns a new instance of AttributeParser.



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

def initialize(arguments, opts)
  @attributes = {}
  @possible_error = ArgumentErrorBuilder.new
  @arguments = arguments
  @opts = opts

  parse!
end

Instance Attribute Details

#attributesObject (readonly)

Returns the value of attribute attributes.



3
4
5
# File 'lib/superstructure/attribute_parser.rb', line 3

def attributes
  @attributes
end

Instance Method Details

#errorObject



18
19
20
# File 'lib/superstructure/attribute_parser.rb', line 18

def error
  @possible_error.build
end

#error?Boolean

Returns:

  • (Boolean)


14
15
16
# File 'lib/superstructure/attribute_parser.rb', line 14

def error?
  @possible_error.error?
end