Class: Cadenya::Types::Schedule_Range

Inherits:
Object
  • Object
show all
Defined in:
lib/cadenya/types.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(start: nil, end_: nil, step: nil) ⇒ Schedule_Range

Returns a new instance of Schedule_Range.



5001
5002
5003
5004
5005
# File 'lib/cadenya/types.rb', line 5001

def initialize(start: nil, end_: nil, step: nil)
  @start = start
  @end_ = end_
  @step = step
end

Instance Attribute Details

#end_Object (readonly)

Returns the value of attribute end_.



4999
5000
5001
# File 'lib/cadenya/types.rb', line 4999

def end_
  @end_
end

#startObject (readonly)

Returns the value of attribute start.



4999
5000
5001
# File 'lib/cadenya/types.rb', line 4999

def start
  @start
end

#stepObject (readonly)

Returns the value of attribute step.



4999
5000
5001
# File 'lib/cadenya/types.rb', line 4999

def step
  @step
end

Class Method Details

.from_json(data) ⇒ Object



5007
5008
5009
5010
5011
5012
5013
# File 'lib/cadenya/types.rb', line 5007

def self.from_json(data)
  new(
    start: data["start"],
    end_: data["end"],
    step: data["step"],
  )
end

Instance Method Details

#to_hObject



5015
5016
5017
5018
5019
5020
5021
# File 'lib/cadenya/types.rb', line 5015

def to_h
  {
    start: Util.plain(@start),
    end_: Util.plain(@end_),
    step: Util.plain(@step),
  }.reject { |_k, v| v.nil? }
end