Exception: Fortnox::UnknownAttributeError

Inherits:
AttributeError show all
Defined in:
lib/fortnox.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attribute_names, subject = nil) ⇒ UnknownAttributeError

Returns a new instance of UnknownAttributeError.



98
99
100
101
102
103
# File 'lib/fortnox.rb', line 98

def initialize(attribute_names, subject = nil)
  @attribute_names = Array(attribute_names)
  @subject = subject
  super("Unknown attribute#{'s' if @attribute_names.length > 1} for #{subject}: " \
        "#{@attribute_names.map(&:inspect).join(', ')}")
end

Instance Attribute Details

#attribute_namesObject (readonly)

Returns the value of attribute attribute_names.



96
97
98
# File 'lib/fortnox.rb', line 96

def attribute_names
  @attribute_names
end

#subjectObject (readonly)

Returns the value of attribute subject.



96
97
98
# File 'lib/fortnox.rb', line 96

def subject
  @subject
end

Instance Method Details

#attribute_nameObject



105
106
107
# File 'lib/fortnox.rb', line 105

def attribute_name
  @attribute_names.first
end