Class: Passifier::Spec

Inherits:
Object
  • Object
show all
Defined in:
lib/passifier/spec.rb

Overview

Pass specification, representing the pass.json file

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(serial_number, hash) ⇒ Spec

Returns a new instance of Spec.

Parameters:

  • serial_number (String)

    An ID for this Spec, used in the pass.json file as the Serial Number

  • hash (Hash)

    The pass.json contents as a hash



13
14
15
16
# File 'lib/passifier/spec.rb', line 13

def initialize(serial_number, hash)
  @serial_number = serial_number
  @hash = hash
end

Instance Attribute Details

#hashObject (readonly) Also known as: to_hash

Returns the value of attribute hash.



8
9
10
# File 'lib/passifier/spec.rb', line 8

def hash
  @hash
end

#serial_numberObject (readonly)

Returns the value of attribute serial_number.



8
9
10
# File 'lib/passifier/spec.rb', line 8

def serial_number
  @serial_number
end

Instance Method Details

#filenameObject



25
26
27
# File 'lib/passifier/spec.rb', line 25

def filename
  "pass.json"
end

#to_jsonString Also known as: content

The contents of the pass.json file

Returns:

  • (String)

    The pass.json contents as a String



20
21
22
# File 'lib/passifier/spec.rb', line 20

def to_json
  to_hash.to_json
end