Class: Urbit::Fact::SettingsEventPutEntryFact
Instance Attribute Summary
Attributes inherited from BaseFact
#ack, #channel, #data, #type
Instance Method Summary
collapse
#base_contents, #bucket, #bucket_key, #desk, #desk_name, #initialize
Methods inherited from BaseFact
#add_ack, #create_parser, #for_this_ship?, #graph_update?, #initialize, #is_acknowledged?, #raw_json, #ship, #to_s
Instance Method Details
#accept ⇒ Object
92
93
94
95
96
97
|
# File 'lib/urbit/fact/settings_fact.rb', line 92
def accept
if (entries = channel.ship.settings[desk: self.desk_name].entries(bucket: self.bucket_key))
entries[self.entry] = self.value
end
end
|
#contents ⇒ Object
99
100
101
|
# File 'lib/urbit/fact/settings_fact.rb', line 99
def contents
self.base_contents["put-entry"]
end
|
#entry ⇒ Object
103
104
105
|
# File 'lib/urbit/fact/settings_fact.rb', line 103
def entry
self.contents["entry-key"]
end
|
#to_h ⇒ Object
107
108
109
110
111
112
|
# File 'lib/urbit/fact/settings_fact.rb', line 107
def to_h
super.merge!({
entry: self.entry,
value: self.value
})
end
|
#value ⇒ Object
114
115
116
|
# File 'lib/urbit/fact/settings_fact.rb', line 114
def value
self.contents["value"]
end
|