Class: SparkleFormation::AuditLog::SourcePoint
- Inherits:
-
Object
- Object
- SparkleFormation::AuditLog::SourcePoint
- Defined in:
- lib/sparkle_formation/audit_log.rb
Instance Attribute Summary collapse
-
#line ⇒ Object
readonly
Returns the value of attribute line.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Instance Method Summary collapse
-
#initialize(*args) ⇒ SourcePoint
constructor
A new instance of SourcePoint.
Constructor Details
#initialize(*args) ⇒ SourcePoint
Returns a new instance of SourcePoint
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/sparkle_formation/audit_log.rb', line 9 def initialize(*args) if args.last.is_a?(Hash) opts = args.pop.to_smash else opts = Smash.new end @path, @line = args @path = opts[:path] if opts[:path] @line = opts[:line] if opts[:line] @line = @line.to_i unless @path raise ArgumentError, "Missing expected value for `path`" end if !@path.is_a?(String) && !@path.is_a?(Symbol) raise TypeError, "Expected `String` or `Symbol` for path but received `#{@path.class}`" end end |
Instance Attribute Details
#line ⇒ Object (readonly)
Returns the value of attribute line
6 7 8 |
# File 'lib/sparkle_formation/audit_log.rb', line 6 def line @line end |
#path ⇒ Object (readonly)
Returns the value of attribute path
7 8 9 |
# File 'lib/sparkle_formation/audit_log.rb', line 7 def path @path end |