Class: SBF::Client::ShaveSchedule

Inherits:
TopLevelEntity show all
Defined in:
lib/stbaldricks/entities/shave_schedule.rb

Defined Under Namespace

Classes: ShaveScheduleAssignment, TimeSelectionPermissions

Constant Summary

Constants inherited from TopLevelEntity

TopLevelEntity::DEFAULT_CLASS_ACTIONS, TopLevelEntity::DEFAULT_CRUD_ACTIONS, TopLevelEntity::DEFAULT_ENDPOINT, TopLevelEntity::DEFAULT_INSTANCE_ACTIONS

Constants inherited from BaseEntity

BaseEntity::ELSE

Instance Attribute Summary collapse

Attributes inherited from BaseEntity

#errors

Instance Method Summary collapse

Methods inherited from TopLevelEntity

_endpoint, action, actions, blacklist_action, class_action, define_endpoint, endpoint, #endpoint, instance_action

Methods included from Entities::Cacheable

#cache_id, included

Methods inherited from BaseEntity

allow_instantiation?, attr_accessor, attr_reader, attr_writer, collection_attributes, defined_attributes, #destroyed?, #dirty_data, entity_attr_accessor, entity_attr_reader, entity_attr_writer, entity_attributes, entity_collection_attr_accessor, entity_collection_attr_reader, entity_collection_attr_writer, #error, inherited, #initialize, #keys_hash, #model_name, multitype_attr_accessor, multitype_attr_reader, multitype_attr_writer, multitype_collection_attr_accessor, multitype_collection_attr_reader, multitype_collection_attr_writer, #not_provided_attributes, optional_attributes, #persisted?, #reload!, #reload_recursive, #rollback!, #to_hash, #to_json, #to_partial

Methods included from EntityResponseConcern

#add_errors, #data, #error?, #errors?, #errors_http_code=, #http_code, #success?

Constructor Details

This class inherits a constructor from SBF::Client::BaseEntity

Instance Attribute Details

#end_timeObject

Returns the value of attribute end_time.



44
45
46
# File 'lib/stbaldricks/entities/shave_schedule.rb', line 44

def end_time
  @end_time
end

#idObject

Returns the value of attribute id.



41
42
43
# File 'lib/stbaldricks/entities/shave_schedule.rb', line 41

def id
  @id
end

#is_publishedObject

Returns the value of attribute is_published.



47
48
49
# File 'lib/stbaldricks/entities/shave_schedule.rb', line 47

def is_published
  @is_published
end

#number_of_seatsObject

Returns the value of attribute number_of_seats.



46
47
48
# File 'lib/stbaldricks/entities/shave_schedule.rb', line 46

def number_of_seats
  @number_of_seats
end

#shave_duration_in_minutesObject

Returns the value of attribute shave_duration_in_minutes.



45
46
47
# File 'lib/stbaldricks/entities/shave_schedule.rb', line 45

def shave_duration_in_minutes
  @shave_duration_in_minutes
end

#start_timeObject

Returns the value of attribute start_time.



43
44
45
# File 'lib/stbaldricks/entities/shave_schedule.rb', line 43

def start_time
  @start_time
end

#yearObject

Returns the value of attribute year.



42
43
44
# File 'lib/stbaldricks/entities/shave_schedule.rb', line 42

def year
  @year
end

Instance Method Details

#owner?Boolean

Returns:



64
65
66
# File 'lib/stbaldricks/entities/shave_schedule.rb', line 64

def owner?
  @permissions.nil? ? false : @permissions.owner?
end

#published?Boolean

Returns:



52
53
54
# File 'lib/stbaldricks/entities/shave_schedule.rb', line 52

def published?
  is_published
end

#shavees_can_schedule_times?Boolean

Returns:



56
57
58
# File 'lib/stbaldricks/entities/shave_schedule.rb', line 56

def shavees_can_schedule_times?
  time_selection_permissions.shavees?
end

#team_captains_can_schedule_times?Boolean

Returns:



60
61
62
# File 'lib/stbaldricks/entities/shave_schedule.rb', line 60

def team_captains_can_schedule_times?
  time_selection_permissions.team_captains?
end

#update(with = {}) ⇒ Object



12
13
14
# File 'lib/stbaldricks/entities/shave_schedule.rb', line 12

def update(with = {})
  endpoint.update(id, year, self, with)
end