Class: TorigoyaKit::Ticket
- Inherits:
-
Object
- Object
- TorigoyaKit::Ticket
- Defined in:
- lib/torigoya_kit/ticket.rb
Instance Attribute Summary collapse
-
#base_name ⇒ Object
readonly
Returns the value of attribute base_name.
-
#build_inst ⇒ Object
readonly
Returns the value of attribute build_inst.
-
#run_inst ⇒ Object
readonly
Returns the value of attribute run_inst.
-
#source_codes ⇒ Object
readonly
Returns the value of attribute source_codes.
Instance Method Summary collapse
- #==(rhs) ⇒ Object
-
#initialize(base_name, source_codes, build_inst, run_inst) ⇒ Ticket
constructor
A new instance of Ticket.
- #to_hash ⇒ Object
- #to_msgpack ⇒ Object
Constructor Details
#initialize(base_name, source_codes, build_inst, run_inst) ⇒ Ticket
Returns a new instance of Ticket.
193 194 195 196 197 198 199 200 |
# File 'lib/torigoya_kit/ticket.rb', line 193 def initialize(base_name, source_codes, build_inst, run_inst) @base_name = base_name # String @source_codes = source_codes # Array!SourceData @build_inst = build_inst # BuildInstruction? @run_inst = run_inst # RunInstruction? validate end |
Instance Attribute Details
#base_name ⇒ Object (readonly)
Returns the value of attribute base_name.
201 202 203 |
# File 'lib/torigoya_kit/ticket.rb', line 201 def base_name @base_name end |
#build_inst ⇒ Object (readonly)
Returns the value of attribute build_inst.
201 202 203 |
# File 'lib/torigoya_kit/ticket.rb', line 201 def build_inst @build_inst end |
#run_inst ⇒ Object (readonly)
Returns the value of attribute run_inst.
201 202 203 |
# File 'lib/torigoya_kit/ticket.rb', line 201 def run_inst @run_inst end |
#source_codes ⇒ Object (readonly)
Returns the value of attribute source_codes.
201 202 203 |
# File 'lib/torigoya_kit/ticket.rb', line 201 def source_codes @source_codes end |
Instance Method Details
#==(rhs) ⇒ Object
216 217 218 219 220 221 |
# File 'lib/torigoya_kit/ticket.rb', line 216 def ==(rhs) return @base_name == rhs.base_name && @source_codes == rhs.source_codes && @build_inst == rhs.build_inst && @run_inst == rhs.run_inst end |
#to_hash ⇒ Object
203 204 205 206 207 208 209 210 |
# File 'lib/torigoya_kit/ticket.rb', line 203 def to_hash return { base_inst: @base_name, sources: @source_codes.map {|x| x.to_hash}, build_inst: unless @build_inst.nil? then @build_inst.to_hash else nil end, run_inst: unless @run_inst.nil? then @run_inst.to_hash else nil end, } end |
#to_msgpack ⇒ Object
212 213 214 |
# File 'lib/torigoya_kit/ticket.rb', line 212 def to_msgpack return to_hash.to_msgpack() end |